org.globus.cog.abstraction.interfaces
Interface FileResource

All Superinterfaces:
GridResource

public interface FileResource
extends GridResource

This interface provides a list of methods that could be used to - establish and maintain connections with remote file servers - browse directories - upload and download files/directories - view and change access permissions


Field Summary
static String FTP
           
static String GridFTP
           
static String Local
           
static String WebDAV
           
 
Fields inherited from interface org.globus.cog.abstraction.interfaces.GridResource
EXECUTION, FILE, INFORMATION
 
Method Summary
 void changeMode(GridFile gridFile)
          Changes the permissions on the file if authorized to do so
 void changeMode(String fileName, int mode)
          Changes the permissions on the file if authorized to do so
 void createDirectory(String directoryName)
          Creates a new directory with the given name
 void deleteDirectory(String directoryName, boolean force)
          Deletes the specified directory.
 void deleteFile(String fileName)
          Deletes the given file
 boolean exists(String fileName)
          Return true if the file exists on the file resource
 Enumeration getAllAttributes()
           
 Object getAttribute(String name)
          Returns attribute value for the given attribute name
 String getCurrentDirectory()
          Returns the current working directory
 void getDirectory(String remoteDirectoryName, String localDirectoryName)
          Transfer the entire directory remoteDirectoryName from the file resource and name it as localDirectoryName on the local machine
 void getFile(String remoteFileName, String localFileName)
          Transfer a remoteFileName file from the file resource and name it as localFileName on the local machine
 GridFile getGridFile(String fileName)
          Get information of a file from the file resource
 void getMultipleFiles(String[] remoteFileNames, String localDirectoryName)
          Copy an array of files from the file resource into the given local directory
 void getMultipleFiles(String[] remoteFileNames, String[] localFileNames)
          Copy an array of files from the file resource into the local file system
 String getProtocol()
          Returns the provider protocol implemented by this FileResource
 SecurityContext getSecurityContext()
          Returns the security context associated with this FileResource
 ServiceContact getServiceContact()
          Returns the service contact associated with this FileResource
 boolean isDirectory(String directoryName)
          Return true if the name points to a directory in the file resource
 boolean isStarted()
          Returns true if a connection to the service has been made
 Collection list()
          Returns the list of files in the current working directory
 Collection list(String directoryName)
          Returns the list of files in the given directory
 void putDirectory(String localDirectoryName, String remoteDirectoryName)
          Upload the localDirectoryName directory from the local machine to remoteDirectoryName on the file resource
 void putFile(String localFileName, String remoteFileName)
          Upload the localFileName from the local machine to remoteFileName on the file resource
 void putMultipleFiles(String[] localFileNames, String remoteDirectoryName)
          Copy an array of files from the local file system into the given remote directory on this file resource
 void putMultipleFiles(String[] localFileNames, String[] remoteFileNames)
          Copy an array of files from the local file system into the file resource
 void rename(String oldFileName, String newFileName)
          Rename a file on the file resource
 void setAttribute(String name, Object value)
          Sets attributes for the file resource instance
 void setCurrentDirectory(String directoryName)
          Changes the current directory to the given directory
 void setSecurityContext(SecurityContext securityContext)
          Sets the security context for this FileResource
 void setServiceContact(ServiceContact serviceContact)
          Sets the service contact for this FileResource
 void start()
          Establishes the connection to the remote service contact
 void stop()
          Closes the connection to the file resource
 void submit(ExecutableObject commandWorkflow)
          Executes a non-interactive workflow of commands on the FileResource
 
Methods inherited from interface org.globus.cog.abstraction.interfaces.GridResource
getIdentity, getName, getType, setIdentity, setName
 

Field Detail

FTP

public static final String FTP
See Also:
Constant Field Values

GridFTP

public static final String GridFTP
See Also:
Constant Field Values

WebDAV

public static final String WebDAV
See Also:
Constant Field Values

Local

public static final String Local
See Also:
Constant Field Values
Method Detail

getProtocol

public String getProtocol()
Returns the provider protocol implemented by this FileResource


setServiceContact

public void setServiceContact(ServiceContact serviceContact)
Sets the service contact for this FileResource


getServiceContact

public ServiceContact getServiceContact()
Returns the service contact associated with this FileResource


setSecurityContext

public void setSecurityContext(SecurityContext securityContext)
Sets the security context for this FileResource


getSecurityContext

public SecurityContext getSecurityContext()
Returns the security context associated with this FileResource


start

public void start()
           throws IllegalHostException,
                  InvalidSecurityContextException,
                  GeneralException
Establishes the connection to the remote service contact

Throws:
IllegalHostException
InvalidSecurityContextException
GeneralException

stop

public void stop()
          throws GeneralException
Closes the connection to the file resource

Throws:
GeneralException

isStarted

public boolean isStarted()
Returns true if a connection to the service has been made


setCurrentDirectory

public void setCurrentDirectory(String directoryName)
                         throws DirectoryNotFoundException,
                                GeneralException
Changes the current directory to the given directory

Throws:
DirectoryNotFoundException
GeneralException

getCurrentDirectory

public String getCurrentDirectory()
                           throws GeneralException
Returns the current working directory

Throws:
GeneralException

list

public Collection list()
                throws GeneralException
Returns the list of files in the current working directory

Throws:
GeneralException

list

public Collection list(String directoryName)
                throws DirectoryNotFoundException,
                       GeneralException
Returns the list of files in the given directory

Throws:
DirectoryNotFoundException
GeneralException

createDirectory

public void createDirectory(String directoryName)
                     throws GeneralException
Creates a new directory with the given name

Throws:
GeneralException

deleteDirectory

public void deleteDirectory(String directoryName,
                            boolean force)
                     throws DirectoryNotFoundException,
                            GeneralException
Deletes the specified directory. If the "force" flag is true, delete non-empty directory too

Throws:
DirectoryNotFoundException
GeneralException

deleteFile

public void deleteFile(String fileName)
                throws FileNotFoundException,
                       GeneralException
Deletes the given file

Throws:
FileNotFoundException
GeneralException

getFile

public void getFile(String remoteFileName,
                    String localFileName)
             throws FileNotFoundException,
                    GeneralException
Transfer a remoteFileName file from the file resource and name it as localFileName on the local machine

Throws:
FileNotFoundException
GeneralException

putFile

public void putFile(String localFileName,
                    String remoteFileName)
             throws FileNotFoundException,
                    GeneralException
Upload the localFileName from the local machine to remoteFileName on the file resource

Throws:
FileNotFoundException
GeneralException

getDirectory

public void getDirectory(String remoteDirectoryName,
                         String localDirectoryName)
                  throws DirectoryNotFoundException,
                         GeneralException
Transfer the entire directory remoteDirectoryName from the file resource and name it as localDirectoryName on the local machine

Throws:
DirectoryNotFoundException
GeneralException

putDirectory

public void putDirectory(String localDirectoryName,
                         String remoteDirectoryName)
                  throws DirectoryNotFoundException,
                         GeneralException
Upload the localDirectoryName directory from the local machine to remoteDirectoryName on the file resource

Throws:
DirectoryNotFoundException
GeneralException

getMultipleFiles

public void getMultipleFiles(String[] remoteFileNames,
                             String[] localFileNames)
                      throws FileNotFoundException,
                             GeneralException
Copy an array of files from the file resource into the local file system

Throws:
FileNotFoundException
GeneralException

getMultipleFiles

public void getMultipleFiles(String[] remoteFileNames,
                             String localDirectoryName)
                      throws FileNotFoundException,
                             DirectoryNotFoundException,
                             GeneralException
Copy an array of files from the file resource into the given local directory

Throws:
FileNotFoundException
DirectoryNotFoundException
GeneralException

putMultipleFiles

public void putMultipleFiles(String[] localFileNames,
                             String[] remoteFileNames)
                      throws FileNotFoundException,
                             GeneralException
Copy an array of files from the local file system into the file resource

Throws:
FileNotFoundException
GeneralException

putMultipleFiles

public void putMultipleFiles(String[] localFileNames,
                             String remoteDirectoryName)
                      throws FileNotFoundException,
                             DirectoryNotFoundException,
                             GeneralException
Copy an array of files from the local file system into the given remote directory on this file resource

Throws:
FileNotFoundException
DirectoryNotFoundException
GeneralException

rename

public void rename(String oldFileName,
                   String newFileName)
            throws FileNotFoundException,
                   GeneralException
Rename a file on the file resource

Throws:
FileNotFoundException
GeneralException

changeMode

public void changeMode(String fileName,
                       int mode)
                throws FileNotFoundException,
                       GeneralException
Changes the permissions on the file if authorized to do so

Throws:
FileNotFoundException
GeneralException

changeMode

public void changeMode(GridFile gridFile)
                throws FileNotFoundException,
                       GeneralException
Changes the permissions on the file if authorized to do so

Throws:
FileNotFoundException
GeneralException

getGridFile

public GridFile getGridFile(String fileName)
                     throws FileNotFoundException,
                            GeneralException
Get information of a file from the file resource

Throws:
FileNotFoundException
GeneralException

exists

public boolean exists(String fileName)
               throws FileNotFoundException,
                      GeneralException
Return true if the file exists on the file resource

Throws:
FileNotFoundException
GeneralException

isDirectory

public boolean isDirectory(String directoryName)
                    throws GeneralException
Return true if the name points to a directory in the file resource

Throws:
GeneralException

submit

public void submit(ExecutableObject commandWorkflow)
            throws IllegalSpecException,
                   TaskSubmissionException
Executes a non-interactive workflow of commands on the FileResource

Throws:
IllegalSpecException
TaskSubmissionException

setAttribute

public void setAttribute(String name,
                         Object value)
Sets attributes for the file resource instance


getAllAttributes

public Enumeration getAllAttributes()

getAttribute

public Object getAttribute(String name)
Returns attribute value for the given attribute name