Package org.nuxeo.ecm.core.blob.binary
Class BinaryBlobProvider
- java.lang.Object
-
- org.nuxeo.ecm.core.blob.binary.BinaryBlobProvider
-
- All Implemented Interfaces:
BlobProvider
public class BinaryBlobProvider extends Object implements BlobProvider
Adapter between theBinaryManagerand aBlobProviderfor theBlobManager.Can be used by legacy implementations of a
BinaryManagerto provide aBlobProviderimplementation.- Since:
- 7.3
-
-
Field Summary
Fields Modifier and Type Field Description protected BinaryManagerbinaryManagerprotected booleansupportsUserUpdateprotected booleantransientFlag
-
Constructor Summary
Constructors Constructor Description BinaryBlobProvider(BinaryManager binaryManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the adaptedBinaryManager.protected voidfixupDigest(Blob blob, String digest)Fixup of the blob's digest, if possible.BinaryManagergetBinaryManager()Gets the associated binary manager, if any.FilegetFile(ManagedBlob blob)Gets aFile(if one exists) for the data of a managed blob.Map<String,String>getProperties()Returns the properties of the blob provider.voidinitialize(String blobProviderId, Map<String,String> properties)Initializes the blob provider.booleanisTransient()Checks whether this blob provider is transient: blobs may disappear after a while, so a caller should not rely on them being available forever.BlobreadBlob(BlobInfo blobInfo)Reads aBlobfrom storage.protected StringstripBlobKeyPrefix(String key)booleansupportsUserUpdate()Checks if user update is supported.protected booleansupportsUserUpdateDefaultTrue(Map<String,String> properties)StringwriteBlob(Blob blob)Writes aBlobto storage and returns information about it.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.ecm.core.blob.BlobProvider
allowByteRange, allowDirectDownload, canConvert, deleteBlob, getAppLinks, getAvailableConversions, getBinaryGarbageCollector, getStatus, getStream, getStream, getThumbnail, getURI, hasCreateFromKeyPermission, isColdStorageMode, isRecordMode, isTransactional, isVersion, performsExternalAccessControl, readBlob, supportsSync, updateBlob, writeBlob
-
-
-
-
Field Detail
-
binaryManager
protected final BinaryManager binaryManager
-
supportsUserUpdate
protected boolean supportsUserUpdate
-
transientFlag
protected boolean transientFlag
-
-
Constructor Detail
-
BinaryBlobProvider
public BinaryBlobProvider(BinaryManager binaryManager)
-
-
Method Detail
-
initialize
public void initialize(String blobProviderId, Map<String,String> properties) throws IOException
Description copied from interface:BlobProviderInitializes the blob provider.- Specified by:
initializein interfaceBlobProvider- Parameters:
blobProviderId- the blob provider id for this binary managerproperties- initialization properties- Throws:
IOException
-
supportsUserUpdate
public boolean supportsUserUpdate()
Description copied from interface:BlobProviderChecks if user update is supported.A user update refers to the fact that a blob from this provider may be overwritten with another blob, wherever the original blob may occur (usually in a document property).
- Specified by:
supportsUserUpdatein interfaceBlobProvider- Returns:
trueif user update is supported
-
supportsUserUpdateDefaultTrue
protected boolean supportsUserUpdateDefaultTrue(Map<String,String> properties)
-
isTransient
public boolean isTransient()
Description copied from interface:BlobProviderChecks whether this blob provider is transient: blobs may disappear after a while, so a caller should not rely on them being available forever.- Specified by:
isTransientin interfaceBlobProvider
-
close
public void close()
Closes the adaptedBinaryManager.- Specified by:
closein interfaceBlobProvider
-
getBinaryManager
public BinaryManager getBinaryManager()
Description copied from interface:BlobProviderGets the associated binary manager, if any.- Specified by:
getBinaryManagerin interfaceBlobProvider- Returns:
- the binary manager, or
null
-
readBlob
public Blob readBlob(BlobInfo blobInfo) throws IOException
Description copied from interface:BlobProviderReads aBlobfrom storage.- Specified by:
readBlobin interfaceBlobProvider- Parameters:
blobInfo- the blob information- Returns:
- the blob
- Throws:
IOException
-
getFile
public File getFile(ManagedBlob blob)
Description copied from interface:BlobProviderGets aFile(if one exists) for the data of a managed blob.- Specified by:
getFilein interfaceBlobProvider- Parameters:
blob- the managed blob- Returns:
- the file, or
nullif no underlying file is available
-
writeBlob
public String writeBlob(Blob blob) throws IOException
Description copied from interface:BlobProviderWrites aBlobto storage and returns information about it.Called to store a user-created blob.
- Specified by:
writeBlobin interfaceBlobProvider- Parameters:
blob- the blob- Returns:
- the blob key
- Throws:
IOException
-
fixupDigest
protected void fixupDigest(Blob blob, String digest)
Fixup of the blob's digest, if possible.- Parameters:
blob- the blobdigest- the digest- Since:
- 11.5
-
getProperties
public Map<String,String> getProperties()
Description copied from interface:BlobProviderReturns the properties of the blob provider.- Specified by:
getPropertiesin interfaceBlobProvider
-
-