public class BinaryBlob extends AbstractBlob implements ManagedBlob, Serializable
TEXT_PLAIN, UTF_8
Constructor and Description |
---|
BinaryBlob(Binary binary,
String filename,
String mimeType,
String encoding,
String digest,
long length) |
Modifier and Type | Method and Description |
---|---|
Binary |
getBinary()
Gets the
Binary attached to this blob. |
String |
getDigest() |
File |
getFile()
If this blob is backed by an actual file, returns it.
|
String |
getKey()
Gets the stored representation of this blob.
|
long |
getLength()
Gets the data length in bytes if known.
|
InputStream |
getStream()
Gets an
InputStream for the data of this blob. |
equals, getByteArray, getCloseableFile, getCloseableFile, getEncoding, getFilename, getMimeType, getString, hashCode, setDigest, setEncoding, setFilename, setMimeType, transferTo, transferTo
getClass, notify, notifyAll, toString, wait, wait, wait
getByteArray, getCloseableFile, getCloseableFile, getEncoding, getFilename, getMimeType, getString, setDigest, setEncoding, setFilename, setMimeType, transferTo, transferTo
public long getLength()
Blob
getLength
in interface Blob
getLength
in class AbstractBlob
public 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
public Binary getBinary()
Binary
attached to this blob.public String getDigest()
getDigest
in interface Blob
getDigest
in class AbstractBlob
public String getKey()
ManagedBlob
getKey
in interface ManagedBlob
public File getFile()
Blob
The returned file may be short-lived (temporary), so should be used immediately.
getFile
in interface Blob
getFile
in class AbstractBlob
null
if the blob is not backed by a fileCopyright © 2015 Nuxeo SA. All rights reserved.