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 Blobpublic String getEncoding()
getEncoding in interface Blobpublic String getFilename()
getFilename in interface Blobpublic String getDigestAlgorithm()
getDigestAlgorithm in interface Blobpublic void setMimeType(String mimeType)
setMimeType in interface Blobpublic void setEncoding(String encoding)
setEncoding in interface Blobpublic void setFilename(String filename)
setFilename in interface Blobpublic File getFile()
BlobThe returned file may be short-lived (temporary), so should be used immediately.
public byte[] getByteArray() throws IOException
getByteArray in interface BlobIOExceptionpublic String getString() throws IOException
getString in interface BlobIOExceptionpublic long getLength()
Blobpublic CloseableFile getCloseableFile() throws IOException
BlobCloseableFile 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 BlobIOExceptionpublic CloseableFile getCloseableFile(String ext) throws IOException
BlobCloseableFile 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 Blobext - the required extension for the file, or null if it doesn't matterIOExceptionpublic void transferTo(OutputStream out) throws IOException
transferTo in interface BlobIOExceptionpublic void transferTo(File file) throws IOException
transferTo in interface BlobIOExceptionprotected boolean equalsStream(Blob other)
Copyright © 2019 Nuxeo. All rights reserved.