|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.planx.xmlstore.io.LocalFileSystem
public class LocalFileSystem
An implementation of FileSystem that uses an on-disk file.
It is not synchronized and should thus be synchronized externally.
| Constructor Summary | |
|---|---|
LocalFileSystem(String name)
Creates a new file system with the specified file name or recreates a previously persisted one. |
|
| Method Summary | |
|---|---|
LocalLocator |
all()
Returns a LocalLocator to all content currently in this
FileSystem. |
LocalLocator |
allocate()
Returns a LocalLocator to a free write position that
can hold size number of bytes. |
LocalLocator |
allocate(int size)
|
LocalLocator |
allocate(int size,
FileSystemIdentifier id)
|
void |
close()
Closes the file system and releases all resources. |
void |
copy(FileSystem fs,
LocalLocator fromLoc,
LocalLocator locTo)
Copies the data at fromLoc in the specified
FileSystem to toLoc in this
FileSystem. |
FileSystemIdentifier |
currentIdentifier()
|
void |
free(LocalLocator l)
Frees the space occupied by the specified LocalLocator. |
DataInput |
getInput(LocalLocator l)
Positions the input at the specified location and returns a DataInput for reading. |
DataOutput |
getOutput(LocalLocator l)
Positions the output at the specified location and returns a DataOutpu for writing. |
boolean |
isContained(LocalLocator loc)
Returns true if the specified LocalLocator
originates from this FileSystem. |
long |
size()
Returns the size of the FileSystem. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LocalFileSystem(String name)
throws IOException
IOException| Method Detail |
|---|
public FileSystemIdentifier currentIdentifier()
currentIdentifier in interface FileSystem
public long size()
throws IOException
FileSystemFileSystem.
size in interface FileSystemIOException
public void close()
throws IOException
FileSystem
close in interface FileSystemIOException
public void copy(FileSystem fs,
LocalLocator fromLoc,
LocalLocator locTo)
throws IOException,
UnknownLocatorException
FileSystemfromLoc in the specified
FileSystem to toLoc in this
FileSystem.
copy in interface FileSystemIOException
UnknownLocatorException
public DataInput getInput(LocalLocator l)
throws IOException,
UnknownLocatorException
FileSystemDataInput for reading. The DataInput is
shared so if multiple threads operate on the same
FileSystem concurrently, external synchronization should
be used.
getInput in interface FileSystemIOException
UnknownLocatorException
public DataOutput getOutput(LocalLocator l)
throws IOException,
UnknownLocatorException
FileSystemDataOutpu for writing. Note, that this can overwrite
existing data. The DataInput is shared so if multiple
threads operate on the same FileSystem
concurrently, external synchronization should be used.
When writing new data FileSystem.allocate() should be called first.
getOutput in interface FileSystemIOException
UnknownLocatorException
public LocalLocator all()
throws IOException
FileSystemLocalLocator to all content currently in this
FileSystem.
all in interface FileSystemIOException
public LocalLocator allocate()
throws IOException
FileSystemLocalLocator to a free write position that
can hold size number of bytes.
allocate in interface FileSystemIOException
public LocalLocator allocate(int size)
throws IOException
allocate in interface FileSystemIOException
public LocalLocator allocate(int size,
FileSystemIdentifier id)
throws IOException
allocate in interface FileSystemIOException
public void free(LocalLocator l)
throws IOException,
UnknownLocatorException
FileSystemLocalLocator.
free in interface FileSystemIOException
UnknownLocatorExceptionpublic boolean isContained(LocalLocator loc)
FileSystemtrue if the specified LocalLocator
originates from this FileSystem.
isContained in interface FileSystempublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||