org.gwe.drivers.fileSystems
Class FileHandle

java.lang.Object
  extended by org.gwe.drivers.ResourceHandle
      extended by org.gwe.drivers.fileSystems.FileHandle
Direct Known Subclasses:
HTTPHandle, JSchHandle, VfsHandle

public abstract class FileHandle
extends ResourceHandle

Since:
Jan 24, 2007
Author:
Marco Ruiz

Field Summary
 
Fields inherited from class org.gwe.drivers.ResourceHandle
link
 
Constructor Summary
FileHandle(ResourceLink<FileHandle> link)
           
 
Method Summary
 void copyTo(FileHandle otherFile)
           
protected  void copyToDir(FileHandle otherFile)
           
protected  FileHandle createCompressedCopyHandle(boolean createFile)
           
abstract  void createFolder()
           
protected  void decompressInto(FileHandle otherFile, java.lang.String directoryName)
           
 boolean delete()
           
abstract  boolean exists()
           
abstract  FileHandle[] getChildren()
          The equivalent of "ls" in a directory.
abstract  java.io.InputStream getInputStream()
           
abstract  java.io.OutputStream getOutputStream()
           
 java.lang.String getPath()
           
abstract  long getSize()
           
 ThinURI getURI()
           
abstract  boolean isDirectory()
           
 boolean isGlob()
           
static void main(java.lang.String[] args)
           
<OBJECT_TYPE>
OBJECT_TYPE
readObject()
           
 void storeObject(java.lang.Object toSerialize)
           
 
Methods inherited from class org.gwe.drivers.ResourceHandle
close, createHostHandle, getLink
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileHandle

public FileHandle(ResourceLink<FileHandle> link)
Method Detail

getURI

public ThinURI getURI()

isDirectory

public abstract boolean isDirectory()
                             throws HandleOperationException
Returns:
is this a directory?
Throws:
HandleOperationException - - system-level error.

getInputStream

public abstract java.io.InputStream getInputStream()
                                            throws HandleOperationException
Throws:
HandleOperationException

getOutputStream

public abstract java.io.OutputStream getOutputStream()
                                              throws HandleOperationException
Throws:
HandleOperationException

createFolder

public abstract void createFolder()
                           throws HandleOperationException
Throws:
HandleOperationException

exists

public abstract boolean exists()
                        throws HandleOperationException
Throws:
HandleOperationException

delete

public boolean delete()
               throws HandleOperationException
Throws:
HandleOperationException

isGlob

public boolean isGlob()

readObject

public <OBJECT_TYPE> OBJECT_TYPE readObject()
                       throws HandleOperationException
Throws:
HandleOperationException

storeObject

public void storeObject(java.lang.Object toSerialize)
                 throws HandleOperationException
Throws:
HandleOperationException

copyTo

public void copyTo(FileHandle otherFile)
            throws HandleOperationException
Throws:
HandleOperationException

copyToDir

protected void copyToDir(FileHandle otherFile)
                  throws HandleOperationException
Throws:
HandleOperationException

createCompressedCopyHandle

protected FileHandle createCompressedCopyHandle(boolean createFile)
                                         throws HandleOperationException
Throws:
HandleOperationException

decompressInto

protected void decompressInto(FileHandle otherFile,
                              java.lang.String directoryName)
                       throws HandleOperationException
Throws:
HandleOperationException

getChildren

public abstract FileHandle[] getChildren()
                                  throws HandleOperationException
The equivalent of "ls" in a directory.

Returns:
a list of files in the directory.
Throws:
HandleOperationException - - system-level error.

getSize

public abstract long getSize()
                      throws HandleOperationException
Returns:
number of bytes in the file
Throws:
HandleOperationException - - system-level error.

getPath

public java.lang.String getPath()

main

public static void main(java.lang.String[] args)
                 throws CredentialNotFoundException,
                        HandleOperationException,
                        java.io.IOException
Throws:
CredentialNotFoundException
HandleOperationException
java.io.IOException


Copyright © 2007-2009. All Rights Reserved.