|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- The type of entries in this archive.U
- The type of directory entries in this archive.public interface Archive<T extends ArchiveEntry<T,U>,U extends ArchiveDirectoryEntry<T,U>>
This interface defines an archive file. The archive file is represented as a
read only Map<AbsoluteLocation, ArchiveEntry>
, i.e. a map containing
the archive's ArchiveEntry
:s keyed under their absolute locations in
the archive.
An archive is opened by creating a new archive object on an archive file.
While the archive is opened, it keeps a read lock on the file (if the file is
ReadLockable
), and it opens and closes new streams
and RandomAccess
objects on it as needed. When
close()
is called on an archive object, the read lock is released
and all open streams on the archive are closed. After the archive has been
closed, all of its methods throw IllegalStateException
.
Archive objects are not safe to use concurrently from several threads
without external synchronization. If the archive file is in a locking
FileSystem
, all threads other than the thread creating
the archive object, manually have to acquire an
EntityLock
for reading the archive file before
using any archive methods. (This requires that the file system locking
strategy permits several read locks on the same entity.) See the EntityFS
documentation for details on file locking.
The ArchiveExtractor
can be used to extract all
entries from an archive.
ArchiveEntry
,
ArchiveBuilder
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Method Summary | |
---|---|
void |
close()
Close this archive and release all of its resources. |
U |
getRootEntry()
Get the archive's root directory. |
Methods inherited from interface java.util.Map |
---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
Method Detail |
---|
U getRootEntry() throws IllegalStateException
IllegalStateException
- If the archive has been closed.void close()
IllegalStateException
.
It is safe to call this method more than once on an archive.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |