net.metanotion.io.s3
Class S3FileSystem

java.lang.Object
  extended by net.metanotion.io.s3.S3FileSystem
All Implemented Interfaces:
FileSystem

public final class S3FileSystem
extends Object
implements FileSystem

FileSystem implementation to use Amazon's S3 service.


Constructor Summary
S3FileSystem()
           
 
Method Summary
 void addListener(FileSystemListener fsl)
          Add a listener to this file system.
 void addListener(FileSystemListener fsl, File root)
          Add a listener to this file system.
 void addListener(FileSystemListener fsl, File root, boolean recursive)
          Add a listener to this file system.
 File getFile(String url)
          Get the file corresponding to a url.
 File getRoot()
          Get the root File object of this file system.
 InputStream openInput(File f)
          Get an input stream to read a file.
 OutputStream openOutput(File f)
          Get an output stream to write a file.
 RandomAccess openRandomAccess(File f)
          Open a file for reading and writing.
 void removeListener(FileSystemListener fsl)
          Remove a listener to this file system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

S3FileSystem

public S3FileSystem()
Method Detail

getRoot

public File getRoot()
Description copied from interface: FileSystem
Get the root File object of this file system.

Specified by:
getRoot in interface FileSystem
Returns:
Root file.

getFile

public File getFile(String url)
Description copied from interface: FileSystem
Get the file corresponding to a url.

Specified by:
getFile in interface FileSystem
Parameters:
url - filename of the file or directory.
Returns:
File object corresponding to a url.

openInput

public InputStream openInput(File f)
Description copied from interface: FileSystem
Get an input stream to read a file.

Specified by:
openInput in interface FileSystem
Parameters:
f - File to open for reading.
Returns:
InputStream to read the file.

openOutput

public OutputStream openOutput(File f)
Description copied from interface: FileSystem
Get an output stream to write a file.

Specified by:
openOutput in interface FileSystem
Parameters:
f - File to open for writing.
Returns:
OutputStream to write the file.

openRandomAccess

public RandomAccess openRandomAccess(File f)
Description copied from interface: FileSystem
Open a file for reading and writing.

Specified by:
openRandomAccess in interface FileSystem
Parameters:
f - File to open.
Returns:
RandomAccess object to read and write the file.

addListener

public void addListener(FileSystemListener fsl)
Description copied from interface: FileSystem
Add a listener to this file system.

Specified by:
addListener in interface FileSystem
Parameters:
fsl - FileSystemListner to call back.

addListener

public void addListener(FileSystemListener fsl,
                        File root)
Description copied from interface: FileSystem
Add a listener to this file system.

Specified by:
addListener in interface FileSystem
Parameters:
fsl - FileSystemListner to call back
root - File or directory to specifically watch.

addListener

public void addListener(FileSystemListener fsl,
                        File root,
                        boolean recursive)
Description copied from interface: FileSystem
Add a listener to this file system.

Specified by:
addListener in interface FileSystem
Parameters:
fsl - FileSystemListner to call back
root - File or directory to specifically watch.
recursive - If true, send events for all children of this file, if false, only events on this file.

removeListener

public void removeListener(FileSystemListener fsl)
Description copied from interface: FileSystem
Remove a listener to this file system.

Specified by:
removeListener in interface FileSystem
Parameters:
fsl - FileSystemListner to remove.