public abstract class AbstractBlob extends Object implements Blob, Serializable
Blob
storing the information other than the byte stream.Modifier and Type | Field and Description |
---|---|
protected String |
digest |
protected String |
encoding |
protected String |
filename |
protected String |
mimeType |
static String |
TEXT_PLAIN |
static String |
UTF_8 |
Constructor and Description |
---|
AbstractBlob() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object) |
protected boolean |
equalsStream(Blob other) |
byte[] |
getByteArray() |
CloseableFile |
getCloseableFile()
Gets a
CloseableFile backing this blob, which must be closed when done by the caller. |
CloseableFile |
getCloseableFile(String ext)
Gets a
CloseableFile backing this blob, which must be closed when done by the caller. |
String |
getDigest() |
String |
getDigestAlgorithm() |
String |
getEncoding() |
File |
getFile()
If this blob is backed by an actual file, returns it.
|
String |
getFilename() |
long |
getLength()
Gets the data length in bytes if known.
|
String |
getMimeType() |
String |
getString() |
int |
hashCode() |
void |
setDigest(String digest) |
void |
setEncoding(String encoding) |
void |
setFilename(String filename) |
void |
setMimeType(String mimeType) |
void |
transferTo(File file) |
void |
transferTo(OutputStream out) |
public static final String UTF_8
public static final String TEXT_PLAIN
public AbstractBlob()
public String getMimeType()
getMimeType
in interface Blob
public String getEncoding()
getEncoding
in interface Blob
public String getFilename()
getFilename
in interface Blob
public String getDigestAlgorithm()
getDigestAlgorithm
in interface Blob
public void setMimeType(String mimeType)
setMimeType
in interface Blob
public void setEncoding(String encoding)
setEncoding
in interface Blob
public void setFilename(String filename)
setFilename
in interface Blob
public File getFile()
Blob
The returned file may be short-lived (temporary), so should be used immediately.
public byte[] getByteArray() throws IOException
getByteArray
in interface Blob
IOException
public String getString() throws IOException
getString
in interface Blob
IOException
public long getLength()
Blob
public CloseableFile getCloseableFile() throws IOException
Blob
CloseableFile
backing this blob, which must be closed when done by the caller.
The returned file may be the original file, a temporary file, or a symbolic link.
getCloseableFile
in interface Blob
IOException
public CloseableFile getCloseableFile(String ext) throws IOException
Blob
CloseableFile
backing this blob, which must be closed when done by the caller.
The returned file may be the original file, a temporary file, or a symbolic link.
getCloseableFile
in interface Blob
ext
- the required extension for the file, or null
if it doesn't matterIOException
public void transferTo(OutputStream out) throws IOException
transferTo
in interface Blob
IOException
public void transferTo(File file) throws IOException
transferTo
in interface Blob
IOException
protected boolean equalsStream(Blob other)
Copyright © 2016 Nuxeo SA. All rights reserved.