eu.unicore.hila.grid
Interface File

All Superinterfaces:
eu.unicore.hila.Resource

public interface File
extends eu.unicore.hila.Resource

Author:
bjoernh 29.05.2009

Method Summary
 void chmod(boolean _readable, boolean _writable, boolean _executable)
          Sets readable, writable, executable flags all at once.
 void copyTo(File _other)
          Copy this File to _other File.
 void copyTo(File _other, boolean _overwrite)
          Copy this File to _other File.
 void copyTo(File _other, boolean _overwrite, boolean _recursive)
          Copy this File to _other File.
 boolean delete()
          Deletes the file.
 boolean delete(boolean _recursive)
           
 boolean exists()
          Checks, whether the File exists().
 SimpleTransfer exportToLocalFile(File localFile)
          Export this File.
 SimpleTransfer exportToLocalFile(File localFile, boolean _overwrite)
          If the target File is a directory, then move this File into the directory and give the new target the same name.
 SimpleTransfer exportToLocalFile(File localFile, boolean _overwrite, boolean _recursive)
           
 SimpleTransfer exportToStream(OutputStream _os)
           
 Storage getStorage()
           
 SimpleTransfer importFromLocalFile(File localFile)
          If the target File is a directory, then move this File into the directory and give the new target the same name.
 SimpleTransfer importFromLocalFile(File localFile, boolean _overwrite)
          If the target File is a directory, then move this File into the directory and give the new target the same name.
 SimpleTransfer importFromLocalFile(File localFile, boolean _overwrite, boolean _recursive)
           
 SimpleTransfer importFromStream(InputStream _is)
           
 SimpleTransfer importFromStream(InputStream _is, boolean _overwrite)
           
 boolean isDirectory()
          Whether this File is a directory.
 boolean isExecutable()
           
 boolean isReadable()
           
 boolean isRoot()
          Whether this file is the root of a storage, i.e. its path inside the storage is the empty path.
 boolean isWritable()
           
 Date lastModified()
           
 List<File> ls()
           
 boolean mkdir()
          Creates a directory at the Location of this File.
 boolean mkdir(boolean _createParents)
           
 void moveTo(File _other)
          Move this File to _other File within a storage.
 void moveTo(File _other, boolean _overwrite)
          Move this File to _other File within a storage.
 void setIsExecutable(boolean _executable)
          Sets the executable flag of the File for the user.
 void setIsReadable(boolean _readable)
          Sets the readable flag of the File for the user.
 void setIsWritable(boolean _writable)
          Sets the writable flag of the File for the user.
 long size()
           
 ThirdPartyTransfer transfer(File _other)
          Transfer this File to _other File.
 ThirdPartyTransfer transfer(File _other, boolean _overwrite)
          Same as transfer(File).
 ThirdPartyTransfer transfer(File _other, boolean _overwrite, boolean _recursive)
          Same as transfer(File).
 
Methods inherited from interface eu.unicore.hila.Resource
getChild, getChildren, getLocation, getMetadata, getName, getParent, ok
 

Method Detail

ls

List<File> ls()
              throws eu.unicore.hila.exceptions.HiLAException
Returns:
In case of a directory, the list of files contained therein, in case of a plain file, the list contains the file itself.
Throws:
eu.unicore.hila.exceptions.HiLAException

isRoot

boolean isRoot()
               throws eu.unicore.hila.exceptions.HiLAException
Whether this file is the root of a storage, i.e. its path inside the storage is the empty path.

Returns:
Throws:
eu.unicore.hila.exceptions.HiLAException

isDirectory

boolean isDirectory()
                    throws eu.unicore.hila.exceptions.HiLAException
Whether this File is a directory. This is only meaningful if the File exists().

Returns:
true, if the file is a directory, false otherwise
Throws:
eu.unicore.hila.exceptions.HiLAException - if the file does not exist.

exists

boolean exists()
               throws eu.unicore.hila.exceptions.HiLAException
Checks, whether the File exists().

Returns:
true, if the File exists(), false otherwise
Throws:
eu.unicore.hila.exceptions.HiLAException

isReadable

boolean isReadable()
                   throws eu.unicore.hila.exceptions.HiLAException
Returns:
true, if this file is readable for the user.
Throws:
eu.unicore.hila.exceptions.HiLAException

setIsReadable

void setIsReadable(boolean _readable)
                   throws eu.unicore.hila.exceptions.HiLAException
Sets the readable flag of the File for the user.

Parameters:
_readable -
Throws:
eu.unicore.hila.exceptions.HiLAException

isWritable

boolean isWritable()
                   throws eu.unicore.hila.exceptions.HiLAException
Returns:
true, if this File is writable for the user.
Throws:
eu.unicore.hila.exceptions.HiLAException

setIsWritable

void setIsWritable(boolean _writable)
                   throws eu.unicore.hila.exceptions.HiLAException
Sets the writable flag of the File for the user.

Parameters:
_writable -
Throws:
eu.unicore.hila.exceptions.HiLAException

isExecutable

boolean isExecutable()
                     throws eu.unicore.hila.exceptions.HiLAException
Returns:
true, if the File is executable for the user.
Throws:
eu.unicore.hila.exceptions.HiLAException

setIsExecutable

void setIsExecutable(boolean _executable)
                     throws eu.unicore.hila.exceptions.HiLAException
Sets the executable flag of the File for the user.

Parameters:
_executable -
Throws:
eu.unicore.hila.exceptions.HiLAException

chmod

void chmod(boolean _readable,
           boolean _writable,
           boolean _executable)
           throws eu.unicore.hila.exceptions.HiLAException
Sets readable, writable, executable flags all at once.

Parameters:
_readable -
_writable -
_executable -
Throws:
eu.unicore.hila.exceptions.HiLAException

delete

boolean delete()
               throws eu.unicore.hila.exceptions.HiLAException
Deletes the file.

Returns:
true, if the file has been deleted successfully, false otherwise.
Throws:
eu.unicore.hila.exceptions.HiLAException

delete

boolean delete(boolean _recursive)
               throws eu.unicore.hila.exceptions.HiLAException
Parameters:
_recursive -
Returns:
Throws:
eu.unicore.hila.exceptions.HiLAException

mkdir

boolean mkdir()
              throws eu.unicore.hila.exceptions.HiLAException
Creates a directory at the Location of this File.

Returns:
true, if the directory has been created, false otherwise
Throws:
eu.unicore.hila.exceptions.HiLAException - If anything went wrong when creating the directory.

mkdir

boolean mkdir(boolean _createParents)
              throws eu.unicore.hila.exceptions.HiLAException
Parameters:
_createParents - whether to recursively create directories and create the parents
Returns:
true, if the directory has been created, false otherwise
Throws:
eu.unicore.hila.exceptions.HiLAException - If anything went wrong when creating the directory.

getStorage

Storage getStorage()
                   throws eu.unicore.hila.exceptions.HiLAException
Returns:
The Storage that this File is located in.
Throws:
eu.unicore.hila.exceptions.HiLAException

importFromLocalFile

SimpleTransfer importFromLocalFile(File localFile)
                                   throws eu.unicore.hila.exceptions.HiLAException
If the target File is a directory, then move this File into the directory and give the new target the same name.

Parameters:
localFile - The local File which to import to this remote File
Returns:
Throws:
eu.unicore.hila.exceptions.HiLAException

importFromLocalFile

SimpleTransfer importFromLocalFile(File localFile,
                                   boolean _overwrite)
                                   throws eu.unicore.hila.exceptions.HiLAException
If the target File is a directory, then move this File into the directory and give the new target the same name.

Parameters:
localFile - The local File which to import to this remote File
_overwrite - whether to overwrite the remote File
Returns:
Throws:
eu.unicore.hila.exceptions.HiLAException

importFromLocalFile

SimpleTransfer importFromLocalFile(File localFile,
                                   boolean _overwrite,
                                   boolean _recursive)
                                   throws eu.unicore.hila.exceptions.HiLAException
Parameters:
localFile -
_overwrite -
_recursive -
Returns:
Throws:
HiLaException
eu.unicore.hila.exceptions.HiLAException

exportToLocalFile

SimpleTransfer exportToLocalFile(File localFile)
                                 throws eu.unicore.hila.exceptions.HiLAException
Export this File. If the target File is a directory, then move this File into the directory and give the new target the same name.

Parameters:
localFile - the local File to export to
Returns:
Throws:
eu.unicore.hila.exceptions.HiLAException

exportToLocalFile

SimpleTransfer exportToLocalFile(File localFile,
                                 boolean _overwrite)
                                 throws eu.unicore.hila.exceptions.HiLAException
If the target File is a directory, then move this File into the directory and give the new target the same name.

Parameters:
localFile - the local File to export to
_overwrite - whether to overwrite the local File
Returns:
Throws:
eu.unicore.hila.exceptions.HiLAException

exportToLocalFile

SimpleTransfer exportToLocalFile(File localFile,
                                 boolean _overwrite,
                                 boolean _recursive)
                                 throws eu.unicore.hila.exceptions.HiLAException
Parameters:
localFile -
_overwrite -
_recursive -
Returns:
Throws:
eu.unicore.hila.exceptions.HiLAException

exportToStream

SimpleTransfer exportToStream(OutputStream _os)
                              throws eu.unicore.hila.exceptions.HiLAException
Returns:
Throws:
eu.unicore.hila.exceptions.HiLAException

importFromStream

SimpleTransfer importFromStream(InputStream _is)
                                throws eu.unicore.hila.exceptions.HiLAException
Parameters:
_outputStream -
Throws:
eu.unicore.hila.exceptions.HiLAException

importFromStream

SimpleTransfer importFromStream(InputStream _is,
                                boolean _overwrite)
                                throws eu.unicore.hila.exceptions.HiLAException
Parameters:
_outputStream -
Throws:
eu.unicore.hila.exceptions.HiLAException

transfer

ThirdPartyTransfer transfer(File _other)
                            throws eu.unicore.hila.exceptions.HiLAException
Transfer this File to _other File. If the target is a directory, then move this File into the directory and give the new target the same name.

Parameters:
_other - The target File
Returns:
Throws:
eu.unicore.hila.exceptions.HiLAException

transfer

ThirdPartyTransfer transfer(File _other,
                            boolean _overwrite)
                            throws eu.unicore.hila.exceptions.HiLAException
Same as transfer(File). If the target is a directory, then move this File into the directory and give the new target the same name.

Parameters:
_other - The target FilerException
_overwrite - whether to overwrite the target File
Returns:
Throws:
eu.unicore.hila.exceptions.HiLAException
See Also:
#transfer(File)}

transfer

ThirdPartyTransfer transfer(File _other,
                            boolean _overwrite,
                            boolean _recursive)
                            throws eu.unicore.hila.exceptions.HiLAException
Same as transfer(File). If the target is a directory, then move this File into the directory and give the new target the same name.

Parameters:
_other - The target FilerException
_overwrite - whether to overwrite the target File
_recursive - whether to transfer directory structures recursively
Returns:
Throws:
eu.unicore.hila.exceptions.HiLAException
See Also:
#transfer(File)}

size

long size()
          throws eu.unicore.hila.exceptions.HiLAException
Returns:
The size of this File in Bytes.
Throws:
eu.unicore.hila.exceptions.HiLAException

lastModified

Date lastModified()
                  throws eu.unicore.hila.exceptions.HiLAException
Returns:
the date when this File was last modified
Throws:
eu.unicore.hila.exceptions.HiLAException

copyTo

void copyTo(File _other)
            throws eu.unicore.hila.exceptions.HiLAException
Copy this File to _other File. Only works within a storage. For remote, third-party transfers use transfer(File). If the target is a directory, then move this File into the directory and give the new target the same name.

Parameters:
_other - The target File.
Throws:
eu.unicore.hila.exceptions.HiLAException

copyTo

void copyTo(File _other,
            boolean _overwrite)
            throws eu.unicore.hila.exceptions.HiLAException
Copy this File to _other File. Only works within a storage. For remote, third-party transfers use transfer(File). If the target is a directory, then move this File into the directory and give the new target the same name.

Parameters:
_other - The target File.
_overwrite - whether to overwrite the target File if it exists
Throws:
eu.unicore.hila.exceptions.HiLAException

copyTo

void copyTo(File _other,
            boolean _overwrite,
            boolean _recursive)
            throws eu.unicore.hila.exceptions.HiLAException
Copy this File to _other File. Only works within a storage. For remote, third-party transfers use transfer(File). If the target is a directory, then move this File into the directory and give the new target the same name.

Parameters:
_other - The target File.
_overwrite - whether to overwrite the target File if it exists
_recursive - whether to copy directory structures recursively
Throws:
eu.unicore.hila.exceptions.HiLAException

moveTo

void moveTo(File _other)
            throws eu.unicore.hila.exceptions.HiLAException
Move this File to _other File within a storage. If the target is a directory, then move this File into the directory and give the new target the same name.

Parameters:
_other - The target File to move to.
Throws:
eu.unicore.hila.exceptions.HiLAException

moveTo

void moveTo(File _other,
            boolean _overwrite)
            throws eu.unicore.hila.exceptions.HiLAException
Move this File to _other File within a storage. If the target is a directory, then move this File into the directory and give the new target the same name.

Parameters:
_other - The target File to move to.
_overwrite - whether to overwrite an existing file.
Throws:
eu.unicore.hila.exceptions.HiLAException


Copyright © 2010-2013 UNICORE. All Rights Reserved.