Interface BlobProvider
- All Known Subinterfaces:
LiveConnectBlobProvider<O>
- All Known Implementing Classes:
AbstractBlobProvider,AbstractCloudBinaryManager,AbstractLiveConnectBlobProvider,AESBlobProvider,AzureBinaryManager,AzureBlobProvider,AzureCDNBinaryManager,BinaryBlobProvider,BlobStoreBlobProvider,BoxBlobProvider,CloudFrontBinaryManager,FilesystemBlobProvider,GoogleDriveBlobProvider,GoogleStorageBinaryManager,GoogleStorageBlobProvider,GridFSBinaryManager,GridFSBlobProvider,InMemoryBlobProvider,LocalBlobProvider,S3BinaryManager,S3BlobProvider
Blobs, which knows how to read and write them.- Since:
- 7.2
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanChecks whether this blob provider allows byte ranges in keys.default booleanChecks whether this blob provider allows direct download.default booleancanConvert(ManagedBlob blob, String mimeType) Checks if the conversion to the givenmimeTypeis supported by theblob.voidclose()Closes this blob provider and releases resources that may be held by it.default voiddeleteBlob(BlobContext blobContext) Deletes a blob from storage.getAppLinks(String user, ManagedBlob blob) Returns a list of application links for the given blob.getAvailableConversions(ManagedBlob blob, BlobManager.UsageHint hint) Gets a map of available MIME type conversions and correspondingURIfor a managed blob.default BinaryGarbageCollectorGets the associated garbage collector, if any.default BinaryManagerDeprecated.default FilegetFile(ManagedBlob blob) Gets aFile(if one exists) for the data of a managed blob.Returns the properties of the blob provider.default BlobStatusgetStatus(ManagedBlob blob) Gets the status of a blob.default InputStreamGets anInputStreamfor a byte range of a managed blob.default InputStreamgetStream(ManagedBlob blob) Gets anInputStreamfor the data of a managed blob.default InputStreamgetThumbnail(ManagedBlob blob) Gets anInputStreamfor a thumbnail of a managed blob.default URIgetURI(ManagedBlob blob, BlobManager.UsageHint hint, javax.servlet.http.HttpServletRequest servletRequest) Gets anURIfor the content of a managed blob.default booleanChecks if current user has the rights to create blobs in the blob provider using a key.voidinitialize(String blobProviderId, Map<String, String> properties) Initializes the blob provider.default booleanChecks whether this blob provider uses "cold storage mode".default booleanChecks whether this blob provider uses "record mode".default booleanChecks whether this blob provider is transactional.default booleanChecks whether this blob provider is transient: blobs may disappear after a while, so a caller should not rely on them being available forever.default booleanisVersion(ManagedBlob blob) Returns true if version of the blob is a version.default booleanperformsExternalAccessControl(BlobInfo blobInfo) Checks if the blob provider performs external access control checks.Reads aBlobfrom storage.default BlobreadBlob(BlobInfoContext blobInfoContext) Reads aBlobfrom storage.default booleanChecks if sync is supported.booleanChecks if user update is supported.default voidupdateBlob(BlobUpdateContext blobUpdateContext) Updates a blob's properties in storage.Writes aBlobto storage and returns information about it.default StringwriteBlob(BlobContext blobContext) Writes aBlobto storage and returns information about it.
-
Method Details
-
initialize
Initializes the blob provider.- Parameters:
blobProviderId- the blob provider id for this binary managerproperties- initialization properties- Throws:
IOException- Since:
- 7.3
-
close
void close()Closes this blob provider and releases resources that may be held by it.- Since:
- 7.3
-
isColdStorageMode
default boolean isColdStorageMode()Checks whether this blob provider uses "cold storage mode".Cold storage mode has the following characteristics:
- transactional (blobs aren't actually written/deleted until the transaction commits, and transaction rollback is possible)
- Since:
- 2021.19
-
isRecordMode
default boolean isRecordMode()Checks whether this blob provider uses "record mode".Record mode has the following characteristics:
- transactional (blobs aren't actually written/deleted until the transaction commits, and transaction rollback is possible),
- can replace or delete a document's blob.
- Since:
- 11.1
-
isTransactional
default boolean isTransactional()Checks whether this blob provider is transactional.A transactional blob provider only writes blobs to final storage at commit time.
- Since:
- 11.1
-
isTransient
default boolean isTransient()Checks whether this blob provider is transient: blobs may disappear after a while, so a caller should not rely on them being available forever.- Since:
- 10.1
-
allowByteRange
default boolean allowByteRange()Checks whether this blob provider allows byte ranges in keys.- Since:
- 11.1
-
allowDirectDownload
default boolean allowDirectDownload()Checks whether this blob provider allows direct download.- Since:
- 2023.7
-
readBlob
Reads aBlobfrom storage.- Parameters:
blobInfoContext- the blob information context- Returns:
- the blob
- Throws:
IOException- Since:
- 11.1
-
readBlob
Reads aBlobfrom storage.- Parameters:
blobInfo- the blob information- Returns:
- the blob
- Throws:
IOException
-
writeBlob
Writes aBlobto storage and returns information about it.Called to store a user-created blob.
- Parameters:
blobContext- the blob context- Returns:
- the blob key
- Throws:
IOException- Since:
- 11.1
-
writeBlob
Writes aBlobto storage and returns information about it.Called to store a user-created blob.
- Parameters:
blob- the blob- Returns:
- the blob key
- Throws:
IOException- Since:
- 9.2
-
updateBlob
Updates a blob's properties in storage.- Parameters:
blobUpdateContext- the blob update context- Throws:
IOException- Since:
- 11.1
-
deleteBlob
Deletes a blob from storage. Only meaningful for a record blob provider.- Parameters:
blobContext- the blob context- Since:
- 11.1
- See Also:
-
getStatus
Gets the status of a blob.- Parameters:
blob- the blob- Throws:
IOException- Since:
- 11.1
-
supportsUserUpdate
boolean supportsUserUpdate()Checks 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).
- Returns:
trueif user update is supported- Since:
- 7.10
-
supportsSync
default boolean supportsSync()Checks if sync is supported.Sync refers to the fact that a blob from this provider may be synced with a remote system (like Nuxeo Drive) or with a process that updates things in the blob (like Binary Metadata, or WOPI).
- Returns:
trueif sync is supported- Since:
- 11.1
-
getStream
Gets anInputStreamfor a byte range of a managed blob.- Parameters:
blobKey- the blob keybyteRange- the byte range- Returns:
- the stream
- Throws:
IOException- Since:
- 11.1
-
getStream
Gets anInputStreamfor the data of a managed blob.Like all
InputStream, the result must be closed when done with it to avoid resource leaks.- Parameters:
blob- the managed blob- Returns:
- the stream
- Throws:
IOException- Since:
- 7.3
-
getFile
Gets aFile(if one exists) for the data of a managed blob.- Parameters:
blob- the managed blob- Returns:
- the file, or
nullif no underlying file is available - Since:
- 11.1
-
getThumbnail
Gets anInputStreamfor a thumbnail of a managed blob.Like all
InputStream, the result must be closed when done with it to avoid resource leaks.- Parameters:
blob- the managed blob- Returns:
- the stream
- Throws:
IOException- Since:
- 7.3
-
getURI
default URI getURI(ManagedBlob blob, BlobManager.UsageHint hint, javax.servlet.http.HttpServletRequest servletRequest) throws IOException Gets anURIfor the content of a managed blob.- Parameters:
blob- the managed blobhint-BlobManager.UsageHintservletRequest- the servlet request, ornull- Returns:
- the
URI, ornullif none available - Throws:
IOException- Since:
- 7.4
-
getAvailableConversions
default Map<String,URI> getAvailableConversions(ManagedBlob blob, BlobManager.UsageHint hint) throws IOException Gets a map of available MIME type conversions and correspondingURIfor a managed blob.- Parameters:
blob- the managed blobhint-BlobManager.UsageHint- Returns:
- a map of MIME types and
URI, which may be empty - Throws:
IOException- Since:
- 7.3
-
canConvert
Checks if the conversion to the givenmimeTypeis supported by theblob.- Parameters:
blob- the managed blobmimeType- the destination mime type- Returns:
trueif this managed blob supports the conversion to the given mime type- Since:
- 10.1
-
isVersion
Returns true if version of the blob is a version.- Parameters:
blob- the managed blob- Returns:
- true if the blob is a version or a revision
- Since:
- 7.3
-
getAppLinks
Returns a list of application links for the given blob.- Throws:
IOException- Since:
- 7.3
-
getBinaryManager
Deprecated.since 2023.9, UseBlobProviderinsteadGets the associated binary manager, if any.- Returns:
- the binary manager, or
null - Since:
- 7.4
-
getBinaryGarbageCollector
Gets the associated garbage collector, if any.- Returns:
- the garbage collector, or
null - Since:
- 11.1
-
performsExternalAccessControl
Checks if the blob provider performs external access control checks.- Parameters:
blobInfo- the blob information to be read- Returns:
trueif the provider performs security checks before reading a blob,falseotherwise- Since:
- 8.4
-
getProperties
Returns the properties of the blob provider.- Since:
- 10.2
-
hasCreateFromKeyPermission
default boolean hasCreateFromKeyPermission()Checks if current user has the rights to create blobs in the blob provider using a key.- Since:
- 10.2
-
BlobProviderinstead