|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.zipxap.vfs.VirtualFileSystem
public class VirtualFileSystem
This class is the typical entry-point for working with virtual file systems.
| Milestone | Who | Date, Time |
|---|---|---|
| Initial Version | K Penrose | June 2009 |
** Note that this table is not intended as an exhaustive list of subtle changes. It is intended to list changes that break the compatibility of older code, or major enhancements/rewrites
| Field Summary | |
|---|---|
static boolean |
DEFAULT_USE_COMPRESSION
|
| Constructor Summary | |
|---|---|
VirtualFileSystem(java.io.File archiveFile,
boolean createIfNecessary,
boolean synchronousMode,
java.lang.String userId)
|
|
VirtualFileSystem(java.io.File archiveFile,
boolean createIfNecessary,
boolean synchronousMode,
java.lang.String userId,
boolean lockArchiveFile)
|
|
VirtualFileSystem(java.io.File archiveFile,
boolean createIfNecessary,
boolean synchronousMode,
java.lang.String userId,
boolean complainIfNotAVirtualFileSystemFile,
boolean useCompression,
CipherSettings cipherSettings,
boolean lockArchiveFile)
|
|
| Method Summary | |
|---|---|
void |
addReindexListener(VFSReindexListener listener)
Add a reindex listener |
void |
close()
Close the virtual file system |
void |
close(boolean condenseBeforeClose)
Close the virtual file system |
java.lang.Long |
condense()
Shrink the virtual file system down as much as possible by filling in empty sectors with full sectors from the end of the file, and dropping trailing empty sectors. |
static java.lang.String |
convertToValidFilename(java.lang.String filename)
Converts the specified filename to a valid filename. |
void |
copyArchive(java.io.File outputFile,
CipherSettings cipherSettings)
Create a new copy of this archive. |
void |
defrag()
This does a hard-core defrag of this virtual file system by copying it, entry by entry, to a new file, and then replacing the original file with the copy. |
java.io.File |
getArchiveFile()
|
VFSFile |
getFile(java.lang.String filePath)
Retrieve the file at the specified path. |
java.lang.String |
getPasswordHint()
|
VFSReindexListener[] |
getReindexListeners()
Get all of the reindex listeners. |
VFSRepository |
getRepository(java.lang.String path)
Get the VFSRepository at the specified path. |
VFSRepository |
getRootRepository()
|
java.lang.String |
getUserId()
|
static boolean |
isLocked(java.io.File archiveFile)
Determine if the specified archive file has already been locked by another instance of the VFS. |
boolean |
isValidated()
|
static boolean |
isValidFilename(java.lang.String filename)
Returns message if invalid, else null if valid. |
boolean |
isVirtualFileSystem()
|
void |
reindexFileSystem()
|
static void |
removeLock(java.io.File archiveFile)
Be careful with this method, it does no checking and is thus very dangerous. |
boolean |
removeReindexListener(VFSReindexListener listener)
Remove a reindex listener. |
void |
setCipherSettings(CipherSettings newCipherSettings)
|
void |
setPassword(java.lang.String password)
|
void |
setPasswordHint(java.lang.String passwordHint)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean DEFAULT_USE_COMPRESSION
| Constructor Detail |
|---|
public VirtualFileSystem(java.io.File archiveFile,
boolean createIfNecessary,
boolean synchronousMode,
java.lang.String userId)
public VirtualFileSystem(java.io.File archiveFile,
boolean createIfNecessary,
boolean synchronousMode,
java.lang.String userId,
boolean lockArchiveFile)
archiveFile - createIfNecessary - synchronousMode - userId - lockArchiveFile - Be very careful. If this is set to false and another
VFS instance opens the same archive and writes to it, the archive will become corrupted.
public VirtualFileSystem(java.io.File archiveFile,
boolean createIfNecessary,
boolean synchronousMode,
java.lang.String userId,
boolean complainIfNotAVirtualFileSystemFile,
boolean useCompression,
CipherSettings cipherSettings,
boolean lockArchiveFile)
archiveFile - createIfNecessary - synchronousMode - userId - complainIfNotAVirtualFileSystemFile - useCompression - cipherSettings - The cipher settings to use, if this VFS is encrypted, else null if it is not encrypted.| Method Detail |
|---|
public static void removeLock(java.io.File archiveFile)
archiveFile - public static boolean isLocked(java.io.File archiveFile)
public void setPasswordHint(java.lang.String passwordHint)
public void setCipherSettings(CipherSettings newCipherSettings)
public void setPassword(java.lang.String password)
public java.lang.String getPasswordHint()
public boolean isValidated()
public void defrag()
public boolean isVirtualFileSystem()
public java.lang.String getUserId()
public void reindexFileSystem()
public VFSRepository getRootRepository()
public VFSRepository getRepository(java.lang.String path)
path -
public VFSFile getFile(java.lang.String filePath)
filePath -
public java.io.File getArchiveFile()
public void close()
public void close(boolean condenseBeforeClose)
public java.lang.Long condense()
public void addReindexListener(VFSReindexListener listener)
listener - public VFSReindexListener[] getReindexListeners()
public boolean removeReindexListener(VFSReindexListener listener)
listener -
true if the specified listener was registered to
this virtual file system and was removed, else false if
the specified listener was not registered to this virtual file system.
public void copyArchive(java.io.File outputFile,
CipherSettings cipherSettings)
outputFile - cipherSettings - public static boolean isValidFilename(java.lang.String filename)
filename - errorMessage - propertyName -
public static java.lang.String convertToValidFilename(java.lang.String filename)
filename - errorMessage - propertyName -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||