public class ZipEntryRepresentation extends StreamRepresentation
release() is called to close the underlying Zip
file.| Modifier and Type | Field and Description |
|---|---|
protected ZipEntry |
entry
The Zip entry.
|
protected ZipFile |
zipFile
The Zip file.
|
UNKNOWN_SIZE| Constructor and Description |
|---|
ZipEntryRepresentation(MediaType mediaType,
ZipFile zipFile,
ZipEntry entry,
int timeToLive)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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(OutputStream outputStream)
Writes the representation to a byte stream.
|
getChannel, getReader, write, writeappend, exhaust, getAvailableSize, getDigest, getDisposition, getExpirationDate, getRange, getRegistration, getSize, getText, hasKnownSize, isAvailable, isEmpty, isSelectable, isTransient, setAvailable, setDigest, setDisposition, setExpirationDate, setListener, setRange, setSize, setTransientgetModificationDate, getTag, setModificationDate, setTagcreateClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, hashCode, includes, isCompatible, setCharacterSet, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType, toStringprotected final ZipEntry entry
protected final ZipFile zipFile
public ZipEntryRepresentation(MediaType mediaType, ZipFile zipFile, ZipEntry entry, int timeToLive)
mediaType - The entry media type.zipFile - The parent Zip archive file.entry - The Zip entry.timeToLive - The time to live before it expires (in seconds).public InputStream getStream() throws IOException
RepresentationgetStream in class RepresentationIOExceptionpublic 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 void write(OutputStream outputStream) throws IOException
RepresentationOutputStream after writing to it as this will be handled by the
Restlet connectors automatically.write in class RepresentationoutputStream - The output stream.IOExceptionCopyright © 2005–2025. All rights reserved.