org.edg.data.reptor.storage
Interface FileHandle

All Known Implementing Classes:
FileHandleCastorSRMImpl, FileHandleGridFTPImpl, FileHandleLocalImpl, FileHandleSEImpl, FileHandleURIImpl

public interface FileHandle

FileHandle is the Interface that defines file based actions.

Version:
$Id: FileHandle.java,v 1.8 2003/05/09 21:07:45 pkunszt Exp $
Author:
Erwin Laure, Heinz Stockinger, Peter Kunszt, Steve Hicks

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.
 

Method Detail

delete

public void delete()
            throws FileHandleException
Deletes the file.

Throws:
FileHandleException - if an error during the delete occurs.

list

public java.lang.String[] list()
                        throws FileHandleException
List the file. If the file is a directory, list the contents of the directory.

Throws:
FileHandleException - if an error during the delete occurs.

exists

public boolean exists()
               throws FileHandleException
Check if the file exists.

Returns:
true if the file exists; false otherwise
Throws:
FileHandleException - if an error during the inquiry occurs.

mkdirs

public void mkdirs()
            throws FileHandleException
Creates all necessary dirs for the file.

Throws:
FileHandleException - if the creation fails

getFileInfo

public FileInfo getFileInfo()
                     throws FileHandleException,
                            java.io.FileNotFoundException
Returns details about this file.

FileHandleException
java.io.FileNotFoundException

getURI

public java.net.URI getURI()
Returns the URI.

Returns:
URI