org.edg.data.reptor.storage
Class FileHandleURIImpl

java.lang.Object
  extended byorg.edg.data.reptor.storage.FileHandleURIImpl
All Implemented Interfaces:
FileHandle

public final class FileHandleURIImpl
extends java.lang.Object
implements FileHandle

FileHandleURIImpl is a dummy implementation of FileHandle that has only the function to convert a URI into a globus URI. All the other methods are unimplemented. This handle is used to invoke FileCopier with HTTP, HTTPS and FTP protocols. Only these three file types are supported.

Version:
$Id: FileHandleURIImpl.java,v 1.11 2004/05/13 14:23:06 jamesc Exp $
Author:
Peter Kunszt

Constructor Summary
FileHandleURIImpl(java.net.URI uri)
          Constructs a new FileHandleURIImpl
 
Method Summary
 void delete()
          Deletes the file.
 boolean exists()
          Check if the file exists
 FileInfo getFileInfo()
          Returns details about this file.
 long getFilesize()
          Returns the filesize.
 java.net.URI getURI()
          Return the URI of the file.
 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

FileHandleURIImpl

public FileHandleURIImpl(java.net.URI uri)
                  throws InvalidFileNameException
Constructs a new FileHandleURIImpl

Parameters:
uri - the URI pointing to the file
Throws:
InvalidFileNameException - if the file uri is not legal for some reason
Method Detail

delete

public void delete()
            throws FileHandleException
Deletes the file.

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

getFilesize

public long getFilesize()
                 throws FileHandleException
Returns the filesize.

Returns:
the fileszize
Throws:
FileHandleException - if an error during evaluating the filesize occurs.

exists

public boolean exists()
Check if the file exists

Specified by:
exists in interface FileHandle
Returns:
true if the file exists; false otherwise

list

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

Specified by:
list in interface FileHandle

getURI

public java.net.URI getURI()
Return the URI of the file.

Specified by:
getURI in interface FileHandle
Returns:
the URI of the file

getFileInfo

public FileInfo getFileInfo()
Description copied from interface: FileHandle
Returns details about this file.

Specified by:
getFileInfo in interface FileHandle
See Also:
FileHandle.getFileInfo()

mkdirs

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

Specified by:
mkdirs in interface FileHandle

toString

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