|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectthings.thinger.io.fs.FSFileSystem
public class FSFileSystem
A disk File System implementation. You must specify the root during construction. Relative paths are not allowed and will result in an Error.
Version History
EPG - Initial - 18 MAR 05
Field Summary |
---|
Fields inherited from interface things.thinger.io.AFileSystem |
---|
ROOT |
Constructor Summary | |
---|---|
FSFileSystem(java.lang.String root)
Proper constructor. |
Method Summary | |
---|---|
static void |
completeDelete(java.io.File theFile,
boolean recurse)
|
boolean |
copy(java.lang.String path,
java.io.InputStream is)
Copy an InputStream to a file designated by the path. |
boolean |
delete(java.lang.String path,
boolean recurse)
Delete a file or directory if it exists at the path given. |
java.lang.String |
describeRoot()
Describe the root to this filesystem. |
boolean |
exists(java.lang.String path)
Report if a path exists at the path given. |
boolean |
isDirectory(java.lang.String path)
Is this a directory? |
boolean |
isFile(java.lang.String path)
Is this a file? |
void |
mkdir(java.lang.String path)
Make the directory. |
java.io.InputStream |
openInputStream(java.lang.String path)
Open a file with an InputStream for input. |
java.io.OutputStream |
openOutputStream(java.lang.String path)
Open a file with an OutputStream for output |
java.util.List<java.lang.String> |
paths(java.lang.String path)
Paths within the given root path. |
long |
size(java.lang.String path)
Current size of the file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FSFileSystem(java.lang.String root) throws java.lang.Throwable
root
- the path tot he root
ThingsException
java.lang.Throwable
Method Detail |
---|
public java.lang.String describeRoot()
describeRoot
in interface AFileSystem
public boolean exists(java.lang.String path)
exists
in interface AFileSystem
path
- the path
public long size(java.lang.String path)
size
in interface AFileSystem
path
- the path
public boolean delete(java.lang.String path, boolean recurse) throws SystemException
delete
in interface AFileSystem
path
- An absolute path to the item.recurse
- If set true, it will delete sub-directories on a directory delete, otherwise it will just delete the files.
things.common.SystemException
SystemException
public boolean isFile(java.lang.String path)
isFile
in interface AFileSystem
path
- the path to the file
public boolean isDirectory(java.lang.String path)
isDirectory
in interface AFileSystem
path
- the path
public java.util.List<java.lang.String> paths(java.lang.String path) throws SystemException
paths
in interface AFileSystem
path
- the path
things.common.SystemException
SystemException
public boolean copy(java.lang.String path, java.io.InputStream is) throws SystemException
copy
in interface AFileSystem
path
- The path to the destination. If the file exists, it will be overwritten. If the path does not exist, it will be created.is
- An InputStream to the source. It should be buffered, so don't bother doing it.
things.common.SystemException
SystemException
public java.io.InputStream openInputStream(java.lang.String path) throws SystemException
openInputStream
in interface AFileSystem
path
- The past to the file to open.
things.common.SystemException
SystemException
public java.io.OutputStream openOutputStream(java.lang.String path) throws SystemException
openOutputStream
in interface AFileSystem
path
- The past to the file to open.
things.common.SystemException
SystemException
public void mkdir(java.lang.String path) throws SystemException
mkdir
in interface AFileSystem
path
- The past to the file to open.
things.common.SystemException
SystemException
public static void completeDelete(java.io.File theFile, boolean recurse) throws java.lang.Throwable
java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |