public class ZipEntryBlob extends AbstractBlob implements Serializable
Blob
backed by an entry in a ZIP file.Modifier and Type | Field and Description |
---|---|
protected ZipEntry |
zipEntry |
protected ZipFile |
zipFile |
digest, encoding, filename, mimeType, TEXT_PLAIN, UTF_8
Constructor and Description |
---|
ZipEntryBlob(ZipFile zipFile,
ZipEntry zipEntry)
Creates a
Blob from an entry in a zip file. |
Modifier and Type | Method and Description |
---|---|
long |
getLength()
Gets the data length in bytes if known.
|
InputStream |
getStream()
Gets an
InputStream for the data of this blob. |
equals, equalsStream, getByteArray, getCloseableFile, getCloseableFile, getDigest, getDigestAlgorithm, getEncoding, getFile, getFilename, getMimeType, getString, hashCode, setDigest, setEncoding, setFilename, setMimeType, transferTo, transferTo
public ZipEntryBlob(ZipFile zipFile, ZipEntry zipEntry)
Blob
from an entry in a zip file. The ZipFile
must not be closed until the stream has
been read.zipFile
- the zip filezipEntry
- the zip entrypublic InputStream getStream() throws IOException
Blob
InputStream
for the data of this blob.
The contract of Blob
is that this method can be called several times and will correctly return a new
InputStream
each time. In other words, several reads of the Blob
can be done.
Like all InputStream
, the result must be closed when done with it to avoid resource leaks.
getStream
in interface Blob
IOException
Copyright © 2017 Nuxeo. All rights reserved.