Package org.nuxeo.ecm.core.blob
Class SimpleManagedBlob
- java.lang.Object
-
- org.nuxeo.ecm.core.api.impl.blob.AbstractBlob
-
- org.nuxeo.ecm.core.blob.SimpleManagedBlob
-
- All Implemented Interfaces:
Serializable
,Blob
,ManagedBlob
public class SimpleManagedBlob extends AbstractBlob implements ManagedBlob
Simple managed blob implementation holding just a key and delegating to its provider for implementation.- Since:
- 7.2
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description String
blobProviderId
String
key
Long
length
-
Fields inherited from class org.nuxeo.ecm.core.api.impl.blob.AbstractBlob
digest, encoding, filename, mimeType, TEXT_PLAIN, UTF_8
-
-
Constructor Summary
Constructors Constructor Description SimpleManagedBlob(String blobProviderId, BlobInfo blobInfo)
SimpleManagedBlob(BlobInfo blobInfo)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static String
blobProviderIdFromKey(String key)
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.String
getProviderId()
Gets the id of theBlobProvider
managing this blob.-
Methods inherited from class org.nuxeo.ecm.core.api.impl.blob.AbstractBlob
equals, equalsStream, getByteArray, getCloseableFile, getCloseableFile, getDigest, getDigestAlgorithm, getEncoding, getFilename, getMimeType, getString, hashCode, setDigest, setEncoding, setFilename, setMimeType, transferTo, transferTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.ecm.core.api.Blob
getByteArray, getCloseableFile, getCloseableFile, getDigest, getDigestAlgorithm, getEncoding, getFilename, getMimeType, getString, setDigest, setEncoding, setFilename, setMimeType, transferTo, transferTo
-
Methods inherited from interface org.nuxeo.ecm.core.blob.ManagedBlob
getStream
-
-
-
-
Constructor Detail
-
SimpleManagedBlob
public SimpleManagedBlob(String blobProviderId, BlobInfo blobInfo)
-
SimpleManagedBlob
public SimpleManagedBlob(BlobInfo blobInfo)
-
-
Method Detail
-
getProviderId
public String getProviderId()
Description copied from interface:ManagedBlob
Gets the id of theBlobProvider
managing this blob.- Specified by:
getProviderId
in interfaceManagedBlob
- Returns:
- the blob provider id
-
getKey
public String getKey()
Description copied from interface:ManagedBlob
Gets the stored representation of this blob.- Specified by:
getKey
in interfaceManagedBlob
- Returns:
- the stored representation
-
blobProviderIdFromKey
protected static String blobProviderIdFromKey(String key)
-
getFile
public File 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.
- Specified by:
getFile
in interfaceBlob
- Specified by:
getFile
in interfaceManagedBlob
- Overrides:
getFile
in classAbstractBlob
- Returns:
- a file, or
null
if the blob is not backed by a file
-
-