net.metanotion.io
Class JavaFileSystem

java.lang.Object
  extended by net.metanotion.io.JavaFileSystem
All Implemented Interfaces:
FileSystem, JFileSystem

public final class JavaFileSystem
extends Object
implements JFileSystem

Implementation of the "normal" file system available through the Java I/O package.


Field Summary
protected static String[] attributes
           
protected  net.metanotion.io.JavaFileSystem.JavaFile jfRoot
           
protected  File jioRoot
           
protected  String[] root
           
protected  String rootCanon
           
protected  String rootFull
           
 
Constructor Summary
JavaFileSystem()
           
JavaFileSystem(String root)
           
 
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.
protected static boolean copy(File src, File dst)
           
 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.
 InputStream openJInput(File f)
          Get a Java intput stream to write a file.
 OutputStream openJOutput(File f)
          Get a Java output stream to write a file.
 RandomAccessFile openJRandomAccess(File f)
          Get a random access to read and write 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
 

Field Detail

attributes

protected static final String[] attributes

root

protected final String[] root

jioRoot

protected final File jioRoot

jfRoot

protected final net.metanotion.io.JavaFileSystem.JavaFile jfRoot

rootCanon

protected final String rootCanon

rootFull

protected final String rootFull
Constructor Detail

JavaFileSystem

public JavaFileSystem()

JavaFileSystem

public JavaFileSystem(String root)
Method Detail

copy

protected static boolean copy(File src,
                              File dst)

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.

openJInput

public InputStream openJInput(File f)
Description copied from interface: JFileSystem
Get a Java intput stream to write a file.

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

openJOutput

public OutputStream openJOutput(File f)
Description copied from interface: JFileSystem
Get a Java output stream to write a file.

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

openJRandomAccess

public RandomAccessFile openJRandomAccess(File f)
Description copied from interface: JFileSystem
Get a random access to read and write a file.

Specified by:
openJRandomAccess in interface JFileSystem
Parameters:
f - File to open.
Returns:
RandomAccessFile 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.