|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectStructuredFileProxy
public class StructuredFileProxy
Used to put off actually creating a structured store until it is needed. Essentially, all methods are delegated to a StructuredFile that is created when the first time a method is called. The file is released after a close() or delete() operation. As an additional precaution, the store is created under a temporary file name, and only renamed to the final filename when the file is closed.
Field Summary | |
---|---|
private File |
finalPath
|
private StructuredFile |
realStore
|
private File |
tmpPath
|
Constructor Summary | |
---|---|
StructuredFileProxy(File path)
|
Method Summary | |
---|---|
void |
close()
Closes the store. |
SubStoreWriter |
createSubStore(String name)
Create a new sub-store with the specified name. |
void |
delete()
Deletes the storage completely (implies close() first) |
String |
getSystemId()
Gets the path, URI, or other unique identifier for this store |
String |
getUserVersion()
Gets the user version (if any) set by StructuredStore.setUserVersion(String) . |
SubStoreReader |
openSubStore(String name)
Opens a pre-existing sub-store for read (or write). |
private StructuredFile |
realStore()
|
void |
setUserVersion(String ver)
Sets a user-defined version number for the file. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private File finalPath
private File tmpPath
private StructuredFile realStore
Constructor Detail |
---|
public StructuredFileProxy(File path)
Method Detail |
---|
public SubStoreWriter createSubStore(String name) throws IOException
StructuredStore
createSubStore
in interface StructuredStore
name
- Name of the sub-file to create. Must not exist.
IOException
public SubStoreReader openSubStore(String name) throws IOException
StructuredStore
openSubStore
in interface StructuredStore
name
- Name of pre-existing sub-store to open.
IOException
public void close() throws IOException
StructuredStore
close
in interface StructuredStore
IOException
public void delete() throws IOException
StructuredStore
delete
in interface StructuredStore
IOException
public String getSystemId()
StructuredStore
getSystemId
in interface StructuredStore
public void setUserVersion(String ver) throws IOException
StructuredStore
StructuredStore.getUserVersion()
.
setUserVersion
in interface StructuredStore
ver
- The version number to set.
IOException
public String getUserVersion()
StructuredStore
StructuredStore.setUserVersion(String)
.
getUserVersion
in interface StructuredStore
private StructuredFile realStore()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |