@NotThreadSafe public class TarOutputShop extends org.apache.commons.compress.archivers.tar.TarArchiveOutputStream implements OutputShop<TarDriverEntry>
Because the TAR file format needs to know each entry's length in advance,
entries from an unknown source are actually written to temp files and copied
to the underlying TarArchiveOutputStream upon a call to their
OutputStream.close() method.
Note that this implies that the close() method may fail with
an IOException.
If the size of an entry is known in advance it's directly written to the
underlying TarArchiveOutputStream instead.
TarInputShop| Constructor and Description |
|---|
TarOutputShop(TarDriver driver,
OutputStream out) |
| Modifier and Type | Method and Description |
|---|---|
TarDriverEntry |
getEntry(String name)
Returns the entry for the given
name or
null if no entry with this name exists in this container. |
OutputSocket<TarDriverEntry> |
getOutputSocket(TarDriverEntry local)
Returns an output socket for writing to the given entry.
|
int |
getSize()
Returns the number of entries in this container.
|
Iterator<TarDriverEntry> |
iterator()
Returns a new iterator for all entries in this container.
|
close, closeArchiveEntry, createArchiveEntry, finish, flush, getBytesWritten, getCount, getRecordSize, putArchiveEntry, setAddPaxHeadersForNonAsciiNames, setBigNumberMode, setLongFileMode, writecanWriteEntryData, count, count, writewriteclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose@CreatesObligation public TarOutputShop(TarDriver driver, @WillCloseWhenClosed OutputStream out)
@CheckForNull public TarDriverEntry getEntry(String name)
EntryContainername or
null if no entry with this name exists in this container.getEntry in interface EntryContainer<TarDriverEntry>name - an entry name.name or
null if no entry with this name exists in this container.public OutputSocket<TarDriverEntry> getOutputSocket(TarDriverEntry local)
OutputServicegetOutputSocket in interface OutputService<TarDriverEntry>local - the entry, which will be the
local target of the returned
output socket.public int getSize()
EntryContainergetSize in interface EntryContainer<TarDriverEntry>public Iterator<TarDriverEntry> iterator()
OutputServiceFirst, 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.
The iterator returned by this method must be unmodifiable.
iterator in interface EntryContainer<TarDriverEntry>iterator in interface OutputService<TarDriverEntry>iterator in interface Iterable<TarDriverEntry>Copyright © 2005-2013 Schlichtherle IT Services. All Rights Reserved.