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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
protected boolean
equalsStream
(Blob other) byte[]
Gets aCloseableFile
backing this blob, which must be closed when done by the caller.getCloseableFile
(String ext) Gets aCloseableFile
backing this blob, which must be closed when done by the caller.getFile()
If this blob is backed by an actual file, returns it.long
Gets the data length in bytes if known.int
hashCode()
void
void
setDigestAlgorithm
(String digestAlgorithm) void
setEncoding
(String encoding) void
setFilename
(String filename) void
setMimeType
(String mimeType) void
transferTo
(File file) void
transferTo
(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:
getMimeType
in interfaceBlob
-
getEncoding
- Specified by:
getEncoding
in interfaceBlob
-
getFilename
- Specified by:
getFilename
in interfaceBlob
-
getDigestAlgorithm
- Specified by:
getDigestAlgorithm
in interfaceBlob
-
getDigest
-
setMimeType
- Specified by:
setMimeType
in interfaceBlob
-
setEncoding
- Specified by:
setEncoding
in interfaceBlob
-
setFilename
- Specified by:
setFilename
in interfaceBlob
-
setDigestAlgorithm
- Specified by:
setDigestAlgorithm
in interfaceBlob
-
setDigest
-
getFile
Description copied from interface:Blob
If 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:
getByteArray
in interfaceBlob
- Throws:
IOException
-
getString
- Specified by:
getString
in interfaceBlob
- Throws:
IOException
-
getLength
public long getLength()Description copied from interface:Blob
Gets the data length in bytes if known. -
getCloseableFile
Description copied from interface:Blob
Gets aCloseableFile
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.
- Specified by:
getCloseableFile
in interfaceBlob
- Returns:
- a closeable file, to be closed when done
- Throws:
IOException
-
getCloseableFile
Description copied from interface:Blob
Gets aCloseableFile
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.
- Specified by:
getCloseableFile
in interfaceBlob
- Parameters:
ext
- the required extension for the file, ornull
if it doesn't matter- Returns:
- a closeable file, to be closed when done
- Throws:
IOException
-
transferTo
- Specified by:
transferTo
in interfaceBlob
- Throws:
IOException
-
transferTo
- Specified by:
transferTo
in interfaceBlob
- Throws:
IOException
-
equals
-
equalsStream
-
hashCode
public int hashCode()
-