|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simantics.databoard.accessor.file.FileLibrary
public class FileLibrary
File library handles sharing of file accessors and automatic closing of files.
On call of getFile or createFile the file library opens a file and returns a file accessor. In concecutive runs the same accessor instance is returned, unless the file was garbage collected. The shared accessor instances are not concurrent-use-safe.
The file handles are actually closed by two ways:
a) File accessor are garbage collected and the the user calls expunge()
b) The user invokes close()
in the FileLibrary.
Files are flushed before closed.
Constructor Summary | |
---|---|
FileLibrary()
Create new file library |
Method Summary | |
---|---|
void |
close()
Close and free all files, this invalidates all existing FileAccessors. |
FileVariantAccessor |
createFile(java.io.File file)
Create a new file and put it in the library. |
boolean |
deleteFile(java.io.File file)
|
void |
expunge()
Close unused file accessors. |
FileVariantAccessor |
getExistingFile(java.io.File file)
Get existing open file accessor. |
FileVariantAccessor |
getFile(java.io.File file)
Open file or get an existing file accessor. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileLibrary()
Method Detail |
---|
public FileVariantAccessor getExistingFile(java.io.File file) throws AccessorConstructionException
file
-
java.io.IOException
AccessorConstructionException
public FileVariantAccessor getFile(java.io.File file) throws AccessorConstructionException
file
-
java.io.IOException
AccessorConstructionException
public FileVariantAccessor createFile(java.io.File file) throws AccessorConstructionException
file
-
AccessorConstructionException
public boolean deleteFile(java.io.File file) throws AccessorException
AccessorException
public void expunge()
public void close()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |