net.sourceforge.taverna.publish
Class AbstractRepository

java.lang.Object
  extended by net.sourceforge.taverna.publish.AbstractRepository
All Implemented Interfaces:
Repository
Direct Known Subclasses:
JxtaRepository, LocalRepository, SFTPRepository, WebDAVRepository

public abstract class AbstractRepository
extends java.lang.Object
implements Repository

This class provides base-level functionality for repositories. Last edited by $Author: sowen70 $

Version:
$Revision: 1.3 $
Author:
Mark

Constructor Summary
AbstractRepository()
           
 
Method Summary
 void delete(org.apache.commons.vfs.FileObject[] filelist)
          This method deletes a list of files from the repository.
 java.lang.String getBaseURL()
          This method sets the base URL for the repository.
 org.apache.commons.vfs.FileObject[] getFileList()
          This method gets all files
 org.apache.commons.vfs.FileObject[] getFileList(org.apache.commons.vfs.FileObject startingDir, org.apache.commons.vfs.FileSelector selector, boolean searchRecursively)
          This method returns a list a files that have been filtered
 org.apache.commons.vfs.FileSystem getFileSystem()
          Constructor
 org.apache.commons.vfs.FileSystemManager getFsManager()
          This method gets the file system manager.
 java.lang.String getName()
          This method gets the name of the Repository.
 org.apache.commons.vfs.FileObject getRoot()
          This method returns the FileObject corresponding to the baseURL.
abstract  void publish(org.apache.commons.vfs.FileObject[] filelist, org.apache.commons.vfs.FileObject startingDir)
          This method publishes a list of files, to selected directory.
 org.apache.commons.vfs.FileObject[] searchByFileName(org.apache.commons.vfs.FileObject startingDir, java.lang.String regex, boolean srchRecursively)
          This method searches the repository for a file whose
 org.apache.commons.vfs.FileObject[] searchByWorkFlowAuthor(org.apache.commons.vfs.FileObject root, java.lang.String authorName, boolean srchRecursively)
          This method searches for workflows whose author is specified by a
 org.apache.commons.vfs.FileObject[] searchByWorkFlowDescription(org.apache.commons.vfs.FileObject startingDir, java.lang.String regex, boolean srchRecursively)
           
 void setBaseURL(java.lang.String baseURL)
          This method sets the base URL for the repository
 void setFileSystem(org.apache.commons.vfs.FileSystem fileSystem)
          This method sets the file system.
 void setFsManager(org.apache.commons.vfs.FileSystemManager fsManager)
          This method sets the file system manager.
 void setName(java.lang.String name)
          This method sets the name of the Repository.
 void setRoot(org.apache.commons.vfs.FileObject root)
          This method sets the root of the repository.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractRepository

public AbstractRepository()
Method Detail

getFileSystem

public org.apache.commons.vfs.FileSystem getFileSystem()
Constructor

Returns:

setFileSystem

public void setFileSystem(org.apache.commons.vfs.FileSystem fileSystem)
This method sets the file system.

Parameters:
fileSystem -

getBaseURL

public java.lang.String getBaseURL()
Description copied from interface: Repository
This method sets the base URL for the repository.

Specified by:
getBaseURL in interface Repository
Returns:
See Also:
Repository.getBaseURL()

setBaseURL

public void setBaseURL(java.lang.String baseURL)
Description copied from interface: Repository
This method sets the base URL for the repository

Specified by:
setBaseURL in interface Repository
See Also:
Repository.setBaseURL(java.lang.String)

getName

public java.lang.String getName()
Description copied from interface: Repository
This method gets the name of the Repository.

Specified by:
getName in interface Repository
Returns:
See Also:
Repository.getName()

setName

public void setName(java.lang.String name)
Description copied from interface: Repository
This method sets the name of the Repository. This name will appear in a list box of repository names, so keep it short.

Specified by:
setName in interface Repository
See Also:
Repository.setName(java.lang.String)

publish

public abstract void publish(org.apache.commons.vfs.FileObject[] filelist,
                             org.apache.commons.vfs.FileObject startingDir)
                      throws PublicationException
Description copied from interface: Repository
This method publishes a list of files, to selected directory. If the directory is null, the filelist will be published to the root of the repository.

Specified by:
publish in interface Repository
Parameters:
filelist - The list of files to be written.
startingDir - The directory in which to deposit the files. This directory is relative to the repository root directory.
Throws:
PublicationException
See Also:
net.sourceforge.taverna.publish.Repository#publish(java.io.File[], java.io.File)

getFsManager

public org.apache.commons.vfs.FileSystemManager getFsManager()
This method gets the file system manager.

Returns:

setFsManager

public void setFsManager(org.apache.commons.vfs.FileSystemManager fsManager)
This method sets the file system manager.

Parameters:
fsManager -

getRoot

public org.apache.commons.vfs.FileObject getRoot()
Description copied from interface: Repository
This method returns the FileObject corresponding to the baseURL.

Specified by:
getRoot in interface Repository
Returns:
See Also:
Repository.getRoot()

setRoot

public void setRoot(org.apache.commons.vfs.FileObject root)
This method sets the root of the repository.

Parameters:
root -

getFileList

public org.apache.commons.vfs.FileObject[] getFileList(org.apache.commons.vfs.FileObject startingDir,
                                                       org.apache.commons.vfs.FileSelector selector,
                                                       boolean searchRecursively)
This method returns a list a files that have been filtered

Parameters:
startingDir -
filter -
searchRecursively -
Returns:

getFileList

public org.apache.commons.vfs.FileObject[] getFileList()
This method gets all files

Returns:

searchByFileName

public org.apache.commons.vfs.FileObject[] searchByFileName(org.apache.commons.vfs.FileObject startingDir,
                                                            java.lang.String regex,
                                                            boolean srchRecursively)
Description copied from interface: Repository
This method searches the repository for a file whose

Specified by:
searchByFileName in interface Repository
Parameters:
startingDir - The directory from which to start the search. This should default to "/" the root directory.
regex - A regular expression that can be applied to each file.
srchRecursively - Indicates whether subdirectories should also be searched for files that match the regular expression
Returns:
A list of files that match the regular expression
See Also:
net.sourceforge.taverna.publish.Repository#searchByFileName(java.io.File, java.lang.String, boolean)

searchByWorkFlowDescription

public org.apache.commons.vfs.FileObject[] searchByWorkFlowDescription(org.apache.commons.vfs.FileObject startingDir,
                                                                       java.lang.String regex,
                                                                       boolean srchRecursively)
Specified by:
searchByWorkFlowDescription in interface Repository
Parameters:
startingDir - The directory from which to start the search. This should default to "/" the root directory.
regex - A regular expression that can be applied to each file.
srchRecursively - Indicates whether subdirectories should also be searched for files that match the regular expression
Returns:
A list of files that match the regular expression
See Also:
net.sourceforge.taverna.publish.Repository#searchByWorkFlowDescription(java.io.File, java.lang.String, boolean)

searchByWorkFlowAuthor

public org.apache.commons.vfs.FileObject[] searchByWorkFlowAuthor(org.apache.commons.vfs.FileObject root,
                                                                  java.lang.String authorName,
                                                                  boolean srchRecursively)
Description copied from interface: Repository
This method searches for workflows whose author is specified by a

Specified by:
searchByWorkFlowAuthor in interface Repository
Parameters:
root - The directory from which to start the search. This should default to "/" the root directory.
srchRecursively - Indicates whether subdirectories should also be searched for files that match the regular expression
Returns:
A list of files that match the regular expression
See Also:
net.sourceforge.taverna.publish.Repository#searchByWorkFlowAuthor(java.io.File[], java.lang.String, boolean)

delete

public void delete(org.apache.commons.vfs.FileObject[] filelist)
            throws PublicationException
Description copied from interface: Repository
This method deletes a list of files from the repository.

Specified by:
delete in interface Repository
Throws:
PublicationException
See Also:
net.sourceforge.taverna.publish.Repository#delete(java.io.File[])