Package org.nuxeo.ecm.core.api.impl.blob
Class AbstractBlob
java.lang.Object
org.nuxeo.ecm.core.api.impl.blob.AbstractBlob
- All Implemented Interfaces:
Serializable,Blob
- Direct Known Subclasses:
BinaryBlob,ByteArrayBlob,FileBlob,SimpleManagedBlob,StringBlob,URLBlob,ZipEntryBlob
Abstract implementation of a
Blob storing the information other than the byte stream.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected booleanequalsStream(Blob other) byte[]Gets aCloseableFilebacking this blob, which must be closed when done by the caller.getCloseableFile(String ext) Gets aCloseableFilebacking this blob, which must be closed when done by the caller.getFile()If this blob is backed by an actual file, returns it.longGets the data length in bytes if known.inthashCode()voidvoidsetDigestAlgorithm(String digestAlgorithm) voidsetEncoding(String encoding) voidsetFilename(String filename) voidsetMimeType(String mimeType) voidtransferTo(File file) voidtransferTo(OutputStream out)
-
Field Details
-
UTF_8
- See Also:
-
TEXT_PLAIN
- See Also:
-
mimeType
-
encoding
-
filename
-
digest
-
digestAlgorithm
-
-
Constructor Details
-
AbstractBlob
public AbstractBlob()
-
-
Method Details
-
getMimeType
- Specified by:
getMimeTypein interfaceBlob
-
getEncoding
- Specified by:
getEncodingin interfaceBlob
-
getFilename
- Specified by:
getFilenamein interfaceBlob
-
getDigestAlgorithm
- Specified by:
getDigestAlgorithmin interfaceBlob
-
getDigest
-
setMimeType
- Specified by:
setMimeTypein interfaceBlob
-
setEncoding
- Specified by:
setEncodingin interfaceBlob
-
setFilename
- Specified by:
setFilenamein interfaceBlob
-
setDigestAlgorithm
- Specified by:
setDigestAlgorithmin interfaceBlob
-
setDigest
-
getFile
Description copied from interface:BlobIf this blob is backed by an actual file, returns it.The returned file may be short-lived (temporary), so should be used immediately.
-
getByteArray
- Specified by:
getByteArrayin interfaceBlob- Throws:
IOException
-
getString
- Specified by:
getStringin interfaceBlob- Throws:
IOException
-
getLength
public long getLength()Description copied from interface:BlobGets the data length in bytes if known. -
getCloseableFile
Description copied from interface:BlobGets aCloseableFilebacking 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.
- Specified by:
getCloseableFilein interfaceBlob- Returns:
- a closeable file, to be closed when done
- Throws:
IOException
-
getCloseableFile
Description copied from interface:BlobGets aCloseableFilebacking 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.
- Specified by:
getCloseableFilein interfaceBlob- Parameters:
ext- the required extension for the file, ornullif it doesn't matter- Returns:
- a closeable file, to be closed when done
- Throws:
IOException
-
transferTo
- Specified by:
transferToin interfaceBlob- Throws:
IOException
-
transferTo
- Specified by:
transferToin interfaceBlob- Throws:
IOException
-
equals
-
equalsStream
-
hashCode
public int hashCode()
-