de.schlichtherle.truezip.fs.archive.zip
Class ZipOutputShop
java.lang.Object
java.io.OutputStream
de.schlichtherle.truezip.io.DecoratingOutputStream
de.schlichtherle.truezip.zip.RawZipOutputStream<ZipArchiveEntry>
de.schlichtherle.truezip.fs.archive.zip.ZipOutputShop
- All Implemented Interfaces:
- EntryContainer<ZipArchiveEntry>, OutputService<ZipArchiveEntry>, OutputShop<ZipArchiveEntry>, Closeable, Flushable, Iterable<ZipArchiveEntry>
@DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class)
public class ZipOutputShop
- extends RawZipOutputStream<ZipArchiveEntry>
- implements OutputShop<ZipArchiveEntry>
An implementation of OutputShop to write ZIP archives.
This output archive can only write one entry at a time.
Archive drivers may wrap this class in a
FsMultiplexedArchiveOutputShop
to overcome this limitation.
- Author:
- Christian Schlichtherle
- See Also:
ZipInputShop
| Methods inherited from class de.schlichtherle.truezip.zip.RawZipOutputStream |
closeEntry, entries, finish, getCharset, getComment, getLevel, getMethod, length, putNextEntry, putNextEntry, setComment, setLevel, setMethod, size, write, write |
pool
private final IOPool<?> pool
postamble
@CheckForNull
private IOPool.Entry<?> postamble
tempEntry
@Nullable
private ZipArchiveEntry tempEntry
ZipOutputShop
public ZipOutputShop(ZipDriver driver,
OutputStream out,
@CheckForNull
ZipInputShop source)
throws IOException
- Throws:
IOException
getSize
public int getSize()
- Specified by:
getSize in interface EntryContainer<ZipArchiveEntry>
iterator
public Iterator<ZipArchiveEntry> iterator()
- Description copied from class:
RawZipOutputStream
- Returns an iteration of all entries written to this ZIP file so
far.
Note that the iteration supports element removal and the returned
entries are shared with this instance.
It is illegal to put more entries into this ZIP output stream
concurrently or modify the state of the iterated entries.
- Specified by:
iterator in interface EntryContainer<ZipArchiveEntry>- Specified by:
iterator in interface Iterable<ZipArchiveEntry>- Overrides:
iterator in class RawZipOutputStream<ZipArchiveEntry>
getEntry
@CheckForNull
public ZipArchiveEntry getEntry(String name)
- Description copied from class:
RawZipOutputStream
- Returns the entry for the given name or
null if no entry with
this name exists.
Note that the returned entry is shared with this instance.
It is illegal to change its state!
- Specified by:
getEntry in interface EntryContainer<ZipArchiveEntry>- Overrides:
getEntry in class RawZipOutputStream<ZipArchiveEntry>
- Parameters:
name - the name of the ZIP entry.
getOutputSocket
public OutputSocket<ZipArchiveEntry> getOutputSocket(ZipArchiveEntry entry)
- Specified by:
getOutputSocket in interface OutputService<ZipArchiveEntry>
isBusy
public final boolean isBusy()
- Returns whether this output archive is busy writing an archive entry
or not.
- Overrides:
isBusy in class RawZipOutputStream<ZipArchiveEntry>
close
public void close()
throws IOException
- Retains the postamble of the source source ZIP file, if any.
- Specified by:
close in interface Closeable- Overrides:
close in class RawZipOutputStream<ZipArchiveEntry>
- Throws:
IOException - On any I/O related issue.
Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.