public class ZipEntryRepresentation extends StreamRepresentation
release() is called to close the underlying Zip
file.| Modifier and Type | Field and Description |
|---|---|
protected java.util.zip.ZipEntry |
entry
The Zip entry.
|
protected java.util.zip.ZipFile |
zipFile
The Zip file.
|
UNKNOWN_SIZE| Constructor and Description |
|---|
ZipEntryRepresentation(MediaType mediaType,
java.util.zip.ZipFile zipFile,
java.util.zip.ZipEntry entry)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
getStream()
Returns a stream with the representation's content.
|
void |
release()
Releases the representation and all associated objects like streams,
channels or files which are used to produce its content, transient or
not.
|
void |
write(java.io.OutputStream outputStream)
Writes the representation to a byte stream.
|
getChannel, getReader, write, writecheckDigest, checkDigest, computeDigest, createEmpty, exhaust, getAvailableSize, getDigest, getDisposition, getDownloadName, getExpirationDate, getRange, getSize, getText, isAvailable, isDownloadable, isTransient, setAvailable, setDigest, setDisposition, setDownloadable, setDownloadName, setExpirationDate, setRange, setSize, setTransientgetModificationDate, getTag, setModificationDate, setTagcreateClientInfo, equals, getCharacterSet, getEncodings, getIdentifier, getLanguages, getLocationRef, getMediaType, includes, isCompatible, setCharacterSet, setEncodings, setIdentifier, setIdentifier, setLanguages, setLocationRef, setLocationRef, setMediaType, toStringprotected final java.util.zip.ZipFile zipFile
protected final java.util.zip.ZipEntry entry
public ZipEntryRepresentation(MediaType mediaType, java.util.zip.ZipFile zipFile, java.util.zip.ZipEntry entry)
mediaType - The entry media type.zipFile - The parent Zip archive file.entry - The Zip entry.public void release()
RepresentationRepresentation.setAvailable(boolean) method
with "false" as a value.Representation.exhaust() method or if this
could be too costly, you should instead explicitly abort the parent
request and the underlying connections using the Request#abort()
method or a shortcut one like ServerResource#abort() or
Response#abort().release in class Representationpublic java.io.InputStream getStream()
throws java.io.IOException
RepresentationgetStream in class Representationjava.io.IOExceptionpublic void write(java.io.OutputStream outputStream)
throws java.io.IOException
RepresentationOutputStream after writing to it as this will be handled by
the Restlet connectors automatically.write in class RepresentationoutputStream - The output stream.java.io.IOExceptionCopyright © 2005-2012. All Rights Reserved.