|
TrueZIP Kernel 7.0-rc1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.schlichtherle.truezip.entry.DecoratingEntryContainer<E,O>
de.schlichtherle.truezip.socket.DecoratingOutputShop<AE,OutputShop<AE>>
de.schlichtherle.truezip.fs.archive.FsMultiplexedArchiveOutputShop<AE>
AE - The type of the archive entries.@NotThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public class FsMultiplexedArchiveOutputShop<AE extends FsArchiveEntry>
Decorates an OutputShop in order to support a virtually
unlimited number of entries which may be written concurrently while
actually at most one entry is written concurrently to the output archive
output.
If there is more than one entry to be written concurrently, the additional
entries are actually written to temp files and copied to the output
output archive upon a call to their OutputStream.close() method.
Note that this implies that the close() method may fail with
an IOException.
| Nested Class Summary | |
|---|---|
private class |
FsMultiplexedArchiveOutputShop.EntryOutputStream
This entry output stream writes directly to the output archive. |
private class |
FsMultiplexedArchiveOutputShop.TempEntriesIterator
|
private class |
FsMultiplexedArchiveOutputShop.TempEntryOutputStream
This entry output stream writes the archive entry to a temporary file. |
| Field Summary | |
|---|---|
private boolean |
busy
|
private IOPool<?> |
pool
|
private Map<String,FsMultiplexedArchiveOutputShop.TempEntryOutputStream> |
temps
The map of temporary archive entries which have not yet been written to the output output archive. |
| Fields inherited from class de.schlichtherle.truezip.entry.DecoratingEntryContainer |
|---|
delegate |
| Constructor Summary | |
|---|---|
FsMultiplexedArchiveOutputShop(OutputShop<AE> output,
IOPool<?> pool)
Constructs a new FsMultiplexedArchiveOutputShop. |
|
| Method Summary | |
|---|---|
void |
close()
|
AE |
getEntry(String name)
Returns the entry for the given name or
null if no entry with this name exists in this container. |
OutputSocket<? extends AE> |
getOutputSocket(AE entry)
Returns an output socket for write access to the given entry. |
int |
getSize()
Returns the number of entries in this container. |
boolean |
isBusy()
Returns whether the container output archive is busy writing an archive entry or not. |
Iterator<AE> |
iterator()
Returns a new iterator over all entries in this container. |
private void |
storeTemps()
|
| Methods inherited from class de.schlichtherle.truezip.entry.DecoratingEntryContainer |
|---|
toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final IOPool<?> pool
private final Map<String,FsMultiplexedArchiveOutputShop.TempEntryOutputStream> temps
private boolean busy
isBusy()| Constructor Detail |
|---|
public FsMultiplexedArchiveOutputShop(OutputShop<AE> output,
IOPool<?> pool)
FsMultiplexedArchiveOutputShop.
output - the decorated output archive.
NullPointerException - iff output is null.| Method Detail |
|---|
public int getSize()
EntryContainer
getSize in interface EntryContainer<AE extends FsArchiveEntry>getSize in class DecoratingEntryContainer<AE extends FsArchiveEntry,OutputShop<AE extends FsArchiveEntry>>public Iterator<AE> iterator()
EntryContainerFirst, the iteration must be consistent: Multiple iterators must iterate the same entries in the same order again unless the set of entries has changed.
Next, the iteration should also reflect the natural order of the entries in this container. For example, if this container represents an archive file, the iteration should reflect the natural order of the entries in the archive file.
iterator in interface EntryContainer<AE extends FsArchiveEntry>iterator in interface Iterable<AE extends FsArchiveEntry>iterator in class DecoratingEntryContainer<AE extends FsArchiveEntry,OutputShop<AE extends FsArchiveEntry>>null iterator over all entries in this
container.@CheckForNull public AE getEntry(String name)
EntryContainername or
null if no entry with this name exists in this container.
getEntry in interface EntryContainer<AE extends FsArchiveEntry>getEntry in class DecoratingEntryContainer<AE extends FsArchiveEntry,OutputShop<AE extends FsArchiveEntry>>name - an entry name.
name or
null if no entry with this name exists in this container.public OutputSocket<? extends AE> getOutputSocket(AE entry)
OutputService
getOutputSocket in interface OutputService<AE extends FsArchiveEntry>getOutputSocket in class DecoratingOutputShop<AE extends FsArchiveEntry,OutputShop<AE extends FsArchiveEntry>>entry - the non-null local target.
public boolean isBusy()
public void close()
throws IOException
close in interface Closeableclose in class DecoratingOutputShop<AE extends FsArchiveEntry,OutputShop<AE extends FsArchiveEntry>>IOException
private void storeTemps()
throws IOException
IOException
|
TrueZIP Kernel 7.0-rc1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||