|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.zipxap.vfs.LowLevelManager
public class LowLevelManager
Provides random access to the archive file. This is ABSOLUTELY single threaded. A VFS file begins "VFS[version][compressed][password hint][expected text]", where the version is two bytes, compressed is either 'C' for compressed or 'U' for uncompressed, 128 bytes of password hint, and 128 bytes of expected text.
| 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
| Method Summary | |
|---|---|
void |
addReindexListener(VFSReindexListener listener)
Add a reindex listener |
void |
close()
Closes this random access file stream and releases any system resources associated with the stream. |
void |
copyArchive(java.io.File outputFile,
CipherSettings cipherSettings)
Create a new copy of this archive. |
Entry |
createEntry(Entry parent,
java.lang.String name,
byte[] data)
This method is used to create a file entry. |
Entry |
createEntry(Entry parent,
java.lang.String name,
EntryType entryType)
This method is used to save an entry that has no associated data (such as a repository), but it can also be used when creating a new File that does yet have data associated with it. |
Entry |
createEntry(Entry parent,
java.lang.String name,
java.io.File sourceFile)
This method is used to create a file entry. |
Entry |
createEntry(Entry parent,
java.lang.String name,
java.io.InputStream inputStream)
This method is used to create a file entry. |
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. |
void |
deleteEntry(Entry entry,
boolean recursive)
Delete the specified entry. |
java.io.File |
getArchiveFile()
|
VFSSector |
getEmptySector(SectorType sectorType)
This method retrieves an empty sector from the list, changes its type from empty to non-empty, and removes it from the list of empty sectors. |
java.util.List<Entry> |
getEntries()
|
long |
getFirstSectorLocation()
|
java.lang.String |
getPasswordHint()
|
java.io.RandomAccessFile |
getRandomAccessFile()
|
VFSReindexListener[] |
getReindexListeners()
Get all of the reindex listeners. |
java.lang.String |
getUserId()
|
boolean |
isClosed()
Determine if the RandomAccessFile resource associated with this LowLevelManager has been closed. |
boolean |
isCompressed()
Determine if the File associated with this instance of the LowLevelManager is using (GZIP) compression. |
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()
|
boolean |
isVirtualFileSystem()
Determine if the File associated with this instance of the LowLevelManager is a valid virtual file system. |
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)
Change the encryption of this vfs. |
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 |
| Method Detail |
|---|
public static boolean isLocked(java.io.File archiveFile)
public static void removeLock(java.io.File archiveFile)
archiveFile -
public Entry createEntry(Entry parent,
java.lang.String name,
EntryType entryType)
parent - name -
public Entry createEntry(Entry parent,
java.lang.String name,
java.io.File sourceFile)
parent - name - sourceFile -
public Entry createEntry(Entry parent,
java.lang.String name,
java.io.InputStream inputStream)
parent - name - inputStream -
public Entry createEntry(Entry parent,
java.lang.String name,
byte[] data)
parent - name - data -
public void deleteEntry(Entry entry,
boolean recursive)
entry - recursive - public boolean isValidated()
public void setCipherSettings(CipherSettings newCipherSettings)
newCipherSettings - public void defrag()
public void setPassword(java.lang.String password)
public void copyArchive(java.io.File outputFile,
CipherSettings cipherSettings)
outputFile - cipherSettings - public java.lang.String getPasswordHint()
public void setPasswordHint(java.lang.String passwordHint)
public void close()
public java.util.List<Entry> getEntries()
public java.lang.String getUserId()
public java.io.File getArchiveFile()
public boolean isClosed()
true if the RandomAccessFile associated with this
LowLevelManager has been closed, else false.public java.io.RandomAccessFile getRandomAccessFile()
public VFSSector getEmptySector(SectorType sectorType)
public boolean isVirtualFileSystem()
true if the File associated with this instance of the
LowLevelManager is a valid virtual file system, else false.public boolean isCompressed()
true if the File associated with this instance of the
LowLevelManager is using (GZIP) compression, else false.public long getFirstSectorLocation()
public void addReindexListener(VFSReindexListener listener)
listener - public VFSReindexListener[] getReindexListeners()
public boolean removeReindexListener(VFSReindexListener listener)
listener -
true if the specified Listener was registered
to this LowLevelManager, and was in fact removed. false
is returned if the specified Listener was not registered to this
LowLevelManager.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||