public class StructuredFileProxy extends Object implements StructuredStore
Modifier and Type | Field and Description |
---|---|
private File |
finalPath |
private StructuredFile |
realStore |
private File |
tmpPath |
Constructor and Description |
---|
StructuredFileProxy(File path) |
Modifier and Type | Method and Description |
---|---|
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.
|
private File finalPath
private File tmpPath
private StructuredFile realStore
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()