eu.unicore.hila.common.grid
Class BaseFile

java.lang.Object
  extended by eu.unicore.hila.common.BaseResource
      extended by eu.unicore.hila.common.grid.BaseFile
All Implemented Interfaces:
File, eu.unicore.hila.Resource

public abstract class BaseFile
extends eu.unicore.hila.common.BaseResource
implements File

Author:
bjoernh 13.08.2009 10:11:42

Field Summary
protected  String path
           
 
Fields inherited from class eu.unicore.hila.common.BaseResource
location
 
Constructor Summary
BaseFile(eu.unicore.hila.Location _location)
           
 
Method Summary
 void chmod(boolean _readable, boolean _writable, boolean _executable)
          Default implementation, delegates to three single calls for setting each of the flags.
 void copyTo(File _other)
          default implementation not overwriting possibly existing target file
 void copyTo(File _other, boolean _overwrite)
          default implementation not overwriting possibly existing target file and not doing recursive copy of directory structures
 boolean delete()
           
 SimpleTransfer exportToLocalFile(File localFile)
          Don't overwrite by default
 SimpleTransfer exportToLocalFile(File localFile, boolean _overwrite)
          Don't do recursive export by default.
 List<eu.unicore.hila.Resource> getChildren()
           
 eu.unicore.hila.Metadata getMetadata()
           
 String getPath()
           
 SimpleTransfer importFromLocalFile(File localFile)
          Don't overwrite by default
 SimpleTransfer importFromLocalFile(File localFile, boolean _overwrite)
          Don't do recursive import by default.
 SimpleTransfer importFromStream(InputStream _is)
          default implementation of importFromStream not overwriting an existing remote file
 boolean isRoot()
           
 boolean mkdir()
          default implementation of mkdir, not creating parent directories
 void moveTo(File _other)
          default implementation not overwriting possibly existing target file
 ThirdPartyTransfer transfer(File _other)
          default implementation not overwriting possibly existing target file
 ThirdPartyTransfer transfer(File _other, boolean _overwrite)
          default implementation not overwriting and not recursive
 
Methods inherited from class eu.unicore.hila.common.BaseResource
findParentLocationOfType, getChild, getLocation, getName, getParent, ok
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface eu.unicore.hila.grid.File
copyTo, delete, exists, exportToLocalFile, exportToStream, getStorage, importFromLocalFile, importFromStream, isDirectory, isExecutable, isReadable, isWritable, lastModified, ls, mkdir, moveTo, setIsExecutable, setIsReadable, setIsWritable, size, transfer
 
Methods inherited from interface eu.unicore.hila.Resource
getChild, getLocation, getName, getParent, ok
 

Field Detail

path

protected String path
Constructor Detail

BaseFile

public BaseFile(eu.unicore.hila.Location _location)
Parameters:
location -
Method Detail

getMetadata

public eu.unicore.hila.Metadata getMetadata()
Specified by:
getMetadata in interface eu.unicore.hila.Resource
Overrides:
getMetadata in class eu.unicore.hila.common.BaseResource
See Also:
Resource.getMetadata()

exportToLocalFile

public SimpleTransfer exportToLocalFile(File localFile)
                                 throws eu.unicore.hila.exceptions.HiLAException
Don't overwrite by default

Specified by:
exportToLocalFile in interface File
Throws:
eu.unicore.hila.exceptions.HiLAException
See Also:
File.exportToLocalFile(java.io.File)

exportToLocalFile

public SimpleTransfer exportToLocalFile(File localFile,
                                        boolean _overwrite)
                                 throws eu.unicore.hila.exceptions.HiLAException
Don't do recursive export by default.

Specified by:
exportToLocalFile in interface File
Throws:
eu.unicore.hila.exceptions.HiLAException
See Also:
File.exportToLocalFile(java.io.File, boolean)

importFromStream

public final SimpleTransfer importFromStream(InputStream _is)
                                      throws eu.unicore.hila.exceptions.HiLAException
default implementation of importFromStream not overwriting an existing remote file

Specified by:
importFromStream in interface File
Throws:
eu.unicore.hila.exceptions.HiLAException
See Also:
eu.unicore.hila.grid.File#importAsStream()

importFromLocalFile

public SimpleTransfer importFromLocalFile(File localFile)
                                   throws eu.unicore.hila.exceptions.HiLAException
Don't overwrite by default

Specified by:
importFromLocalFile in interface File
Throws:
eu.unicore.hila.exceptions.HiLAException
See Also:
File.importFromLocalFile(java.io.File)

importFromLocalFile

public SimpleTransfer importFromLocalFile(File localFile,
                                          boolean _overwrite)
                                   throws eu.unicore.hila.exceptions.HiLAException
Don't do recursive import by default.

Specified by:
importFromLocalFile in interface File
Throws:
eu.unicore.hila.exceptions.HiLAException
See Also:
File.importFromLocalFile(java.io.File, boolean)

chmod

public void chmod(boolean _readable,
                  boolean _writable,
                  boolean _executable)
           throws eu.unicore.hila.exceptions.HiLAException
Default implementation, delegates to three single calls for setting each of the flags. Implementations may override this with more efficient code.

Specified by:
chmod in interface File
Throws:
eu.unicore.hila.exceptions.HiLAException
See Also:
File.chmod(boolean, boolean, boolean)

copyTo

public void copyTo(File _other)
            throws eu.unicore.hila.exceptions.HiLAException
default implementation not overwriting possibly existing target file

Specified by:
copyTo in interface File
Throws:
eu.unicore.hila.exceptions.HiLAException
See Also:
File.copyTo(eu.unicore.hila.grid.File)

copyTo

public void copyTo(File _other,
                   boolean _overwrite)
            throws eu.unicore.hila.exceptions.HiLAException
default implementation not overwriting possibly existing target file and not doing recursive copy of directory structures

Specified by:
copyTo in interface File
Throws:
eu.unicore.hila.exceptions.HiLAException
See Also:
File.copyTo(eu.unicore.hila.grid.File, boolean)

moveTo

public void moveTo(File _other)
            throws eu.unicore.hila.exceptions.HiLAException
default implementation not overwriting possibly existing target file

Specified by:
moveTo in interface File
Throws:
eu.unicore.hila.exceptions.HiLAException
See Also:
File.moveTo(eu.unicore.hila.grid.File)

mkdir

public final boolean mkdir()
                    throws eu.unicore.hila.exceptions.HiLAException
default implementation of mkdir, not creating parent directories

Specified by:
mkdir in interface File
Throws:
eu.unicore.hila.exceptions.HiLAException
See Also:
File.mkdir()

transfer

public ThirdPartyTransfer transfer(File _other)
                            throws eu.unicore.hila.exceptions.HiLAException
default implementation not overwriting possibly existing target file

Specified by:
transfer in interface File
Throws:
eu.unicore.hila.exceptions.HiLAException
See Also:
File.transfer(eu.unicore.hila.grid.File)

transfer

public ThirdPartyTransfer transfer(File _other,
                                   boolean _overwrite)
                            throws eu.unicore.hila.exceptions.HiLAException
default implementation not overwriting and not recursive

Specified by:
transfer in interface File
Throws:
eu.unicore.hila.exceptions.HiLAException
See Also:
File.transfer(eu.unicore.hila.grid.File, boolean)

delete

public boolean delete()
               throws eu.unicore.hila.exceptions.HiLAException
Specified by:
delete in interface File
Throws:
eu.unicore.hila.exceptions.HiLAException
See Also:
File.delete()

isRoot

public boolean isRoot()
Specified by:
isRoot in interface File
See Also:
File.isRoot()

getPath

public String getPath()
Returns:

getChildren

public List<eu.unicore.hila.Resource> getChildren()
                                           throws eu.unicore.hila.exceptions.HiLAException
Specified by:
getChildren in interface eu.unicore.hila.Resource
Throws:
eu.unicore.hila.exceptions.HiLAException
See Also:
Resource.getChildren()


Copyright © 2010-2013 UNICORE. All Rights Reserved.