com.nutiteq.fs
Class JSR75FileSystem

java.lang.Object
  extended by com.nutiteq.fs.JSR75FileSystem
All Implemented Interfaces:
FileSystem

public class JSR75FileSystem
extends java.lang.Object
implements FileSystem

This class includes implementation for reading files using JSR-75.

Author:
CristiS

Constructor Summary
JSR75FileSystem()
           
 
Method Summary
 java.util.Vector getRoots()
          List all roots in the filesystem
 boolean isDirectory(java.lang.String filename)
          Check if a file is a directory
 java.util.Vector listFiles(java.lang.String path)
          List all files in a directory.
 FileSystemConnection openConnectionToFile(java.lang.String fileName)
           
 byte[] readFile(java.lang.String filename)
          Read a file using JSR-75 API.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSR75FileSystem

public JSR75FileSystem()
Method Detail

readFile

public byte[] readFile(java.lang.String filename)
                throws java.io.IOException
Read a file using JSR-75 API.

Specified by:
readFile in interface FileSystem
Parameters:
filename - fully-qualified file path following "file:///" qualifier
Returns:
file data
Throws:
java.io.IOException - if an exception occurs

getRoots

public java.util.Vector getRoots()
List all roots in the filesystem

Specified by:
getRoots in interface FileSystem
Returns:
a vector containing all the roots
See Also:
FileSystem.getRoots()

listFiles

public java.util.Vector listFiles(java.lang.String path)
                           throws java.io.IOException
List all files in a directory.

Specified by:
listFiles in interface FileSystem
Parameters:
path - path to list, null to list root
Returns:
a vector of file names
Throws:
java.io.IOException

isDirectory

public boolean isDirectory(java.lang.String filename)
Check if a file is a directory

Specified by:
isDirectory in interface FileSystem
Parameters:
filename - file to check
Returns:
true if it is a directory

openConnectionToFile

public FileSystemConnection openConnectionToFile(java.lang.String fileName)
                                          throws java.io.IOException
Specified by:
openConnectionToFile in interface FileSystem
Throws:
java.io.IOException