org.edg.data.reptor.storage
Class FileHandleCastorSRMImpl

java.lang.Object
  |
  +--org.edg.data.reptor.storage.FileHandleCastorSRMImpl
All Implemented Interfaces:
FileHandle

public class FileHandleCastorSRMImpl
extends java.lang.Object
implements FileHandle

Castor SRM file handle

Version:
$Id: FileHandleCastorSRMImpl.java,v 1.3 2003/06/12 18:22:50 pkunszt Exp $
Author:
Peter Kunszt

Constructor Summary
FileHandleCastorSRMImpl(java.net.URI file, Configuration config)
          Constructor.
 
Method Summary
 void delete()
          Deletes the file.
 boolean exists()
          Check if the file exists.
 FileInfo getFileInfo()
          Returns details about this file.
 java.net.URI getURI()
          Returns the URI.
 java.lang.String[] list()
          List the file.
 void mkdirs()
          Creates all necessary dirs for the file.
 java.lang.String toString()
          Returns a string representation of the FileHandle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileHandleCastorSRMImpl

public FileHandleCastorSRMImpl(java.net.URI file,
                               Configuration config)
                        throws FileHandleException,
                               NotCastorSRMException,
                               InfoServiceException,
                               StorageResourceException
Constructor.

Parameters:
file - the URI of the file to construct the handle of
config - the configuration object
Throws:
FileHandleException
NotCastorSRMException
InfoServiceException
StorageResourceException
Method Detail

delete

public void delete()
            throws FileHandleException
Description copied from interface: FileHandle
Deletes the file.

Specified by:
delete in interface FileHandle
Throws:
FileHandleException - if an error during the delete occurs.
See Also:
FileHandle.delete()

exists

public boolean exists()
               throws FileHandleException
Description copied from interface: FileHandle
Check if the file exists.

Specified by:
exists in interface FileHandle
Returns:
true if the file exists; false otherwise
Throws:
FileHandleException - if an error during the inquiry occurs.
See Also:
FileHandle.exists()

list

public java.lang.String[] list()
                        throws FileHandleException
Description copied from interface: FileHandle
List the file. If the file is a directory, list the contents of the directory.

Specified by:
list in interface FileHandle
Throws:
FileHandleException - if an error during the delete occurs.

getFileInfo

public FileInfo getFileInfo()
                     throws FileHandleException,
                            java.io.FileNotFoundException
Description copied from interface: FileHandle
Returns details about this file.

Specified by:
getFileInfo in interface FileHandle
FileHandleException
java.io.FileNotFoundException
See Also:
FileHandle.getFileInfo()

mkdirs

public void mkdirs()
            throws FileHandleException
Description copied from interface: FileHandle
Creates all necessary dirs for the file.

Specified by:
mkdirs in interface FileHandle
Throws:
FileHandleException - if the creation fails
See Also:
FileHandle.mkdirs()

getURI

public java.net.URI getURI()
Description copied from interface: FileHandle
Returns the URI.

Specified by:
getURI in interface FileHandle
Returns:
URI

toString

public java.lang.String toString()
Returns a string representation of the FileHandle.

Overrides:
toString in class java.lang.Object