org.restlet.engine.local
Class ZipEntryRepresentation

java.lang.Object
  extended by org.restlet.representation.Variant
      extended by org.restlet.representation.RepresentationInfo
          extended by org.restlet.representation.Representation
              extended by org.restlet.representation.StreamRepresentation
                  extended by org.restlet.engine.local.ZipEntryRepresentation

public class ZipEntryRepresentation
extends StreamRepresentation

An entry in a Zip/JAR file. It is very important release() is called to close the underlying Zip file.

Author:
Remi Dewitte

Field Summary
protected  ZipEntry entry
          The Zip entry.
protected  ZipFile zipFile
          The Zip file.
 
Fields inherited from class org.restlet.representation.Representation
UNKNOWN_SIZE
 
Constructor Summary
ZipEntryRepresentation(MediaType mediaType, ZipFile zipFile, ZipEntry entry)
          Constructor.
 
Method Summary
 InputStream getStream()
           
 void release()
           
 void write(OutputStream outputStream)
           
 
Methods inherited from class org.restlet.representation.StreamRepresentation
getChannel, getReader, write, write
 
Methods inherited from class org.restlet.representation.Representation
append, exhaust, getAvailableSize, getDigest, getDisposition, getExpirationDate, getRange, getRegistration, getSize, getText, hasKnownSize, isAvailable, isEmpty, isSelectable, isTransient, setAvailable, setDigest, setDisposition, setExpirationDate, setListener, setRange, setSize, setTransient
 
Methods inherited from class org.restlet.representation.RepresentationInfo
getModificationDate, getTag, setModificationDate, setTag
 
Methods inherited from class org.restlet.representation.Variant
createClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, includes, isCompatible, setCharacterSet, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

zipFile

protected final ZipFile zipFile
The Zip file.


entry

protected final ZipEntry entry
The Zip entry.

Constructor Detail

ZipEntryRepresentation

public ZipEntryRepresentation(MediaType mediaType,
                              ZipFile zipFile,
                              ZipEntry entry)
Constructor.

Parameters:
mediaType - The entry media type.
zipFile - The parent Zip archive file.
entry - The Zip entry.
Method Detail

release

public void release()
Overrides:
release in class Representation

getStream

public InputStream getStream()
                      throws IOException
Specified by:
getStream in class Representation
Throws:
IOException

write

public void write(OutputStream outputStream)
           throws IOException
Specified by:
write in class Representation
Throws:
IOException


Copyright © 2005-2013 Restlet.