net.metanotion.io
Interface FileSystem

All Known Subinterfaces:
JFileSystem
All Known Implementing Classes:
ChRootFileSystem, JavaFileSystem, JFileSystemAdapter, MountingFileSystem, RAMDiskFileSystem, S3FileSystem

public interface FileSystem

Abstract definition of a File System Object.


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.
 

Method Detail

getRoot

File getRoot()
Get the root File object of this file system.

Returns:
Root file.

getFile

File getFile(String url)
Get the file corresponding to a url.

Parameters:
url - filename of the file or directory.
Returns:
File object corresponding to a url.

openInput

InputStream openInput(File f)
Get an input stream to read a file.

Parameters:
f - File to open for reading.
Returns:
InputStream to read the file.

openOutput

OutputStream openOutput(File f)
Get an output stream to write a file.

Parameters:
f - File to open for writing.
Returns:
OutputStream to write the file.

openRandomAccess

RandomAccess openRandomAccess(File f)
Open a file for reading and writing.

Parameters:
f - File to open.
Returns:
RandomAccess object to read and write the file.

addListener

void addListener(FileSystemListener fsl)
Add a listener to this file system.

Parameters:
fsl - FileSystemListner to call back.

addListener

void addListener(FileSystemListener fsl,
                 File root)
Add a listener to this file system.

Parameters:
fsl - FileSystemListner to call back
root - File or directory to specifically watch.

addListener

void addListener(FileSystemListener fsl,
                 File root,
                 boolean recursive)
Add a listener to this file system.

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

void removeListener(FileSystemListener fsl)
Remove a listener to this file system.

Parameters:
fsl - FileSystemListner to remove.