|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.jxta.search.resolver.io.Directory | +--net.jxta.search.resolver.io.FSDirectory
Straightforward implementation of Directory as a directory of files.
Directory
Constructor Summary | |
FSDirectory(java.io.File path,
boolean create)
|
|
FSDirectory(java.lang.String path,
boolean create)
|
Method Summary | |
void |
close()
Closes the store to future operations. |
Output |
createFile(java.lang.String name)
Creates a new, empty file in the directory with the given name. |
void |
deleteFile(java.lang.String name)
Removes an existing file in the directory. |
boolean |
fileExists(java.lang.String name)
Returns true iff a file with the given name exists. |
long |
fileLength(java.lang.String name)
Returns the length in bytes of a file in the directory. |
static long |
fileModified(java.io.File directory,
java.lang.String name)
Returns the time the named file was last modified. |
long |
fileModified(java.lang.String name)
Returns the time the named file was last modified. |
java.lang.String[] |
list()
Returns an array of strings, one for each file in the directory. |
static void |
main(java.lang.String[] args)
|
Input |
openFile(java.lang.String name)
Returns a stream reading an existing file. |
void |
renameFile(java.lang.String from,
java.lang.String to)
Renames an existing file in the directory. |
Methods inherited from class net.jxta.search.resolver.io.Directory |
readVIntFile, readVLongFile, writeVIntFile, writeVLongFile |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FSDirectory(java.lang.String path, boolean create) throws java.io.IOException
public FSDirectory(java.io.File path, boolean create) throws java.io.IOException
Method Detail |
public final java.lang.String[] list() throws java.io.IOException
list
in class Directory
public final boolean fileExists(java.lang.String name) throws java.io.IOException
fileExists
in class Directory
public final long fileModified(java.lang.String name) throws java.io.IOException
fileModified
in class Directory
public static final long fileModified(java.io.File directory, java.lang.String name) throws java.io.IOException
public final long fileLength(java.lang.String name) throws java.io.IOException
fileLength
in class Directory
public final void deleteFile(java.lang.String name) throws java.io.IOException
deleteFile
in class Directory
public final void renameFile(java.lang.String from, java.lang.String to) throws java.io.IOException
renameFile
in class Directory
public final Output createFile(java.lang.String name) throws java.io.IOException
createFile
in class Directory
public final Input openFile(java.lang.String name) throws java.io.IOException
openFile
in class Directory
public final void close() throws java.io.IOException
close
in class Directory
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |