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
public interface BlobProviderInterface for a provider ofBlobs, which knows how to read and write them.- Since:
- 7.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleanallowByteRange()Checks whether this blob provider allows byte ranges in keys.default booleanallowDirectDownload()Checks 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.default List<AppLink>getAppLinks(String user, ManagedBlob blob)Returns a list of application links for the given blob.default Map<String,URI>getAvailableConversions(ManagedBlob blob, BlobManager.UsageHint hint)Gets a map of available MIME type conversions and correspondingURIfor a managed blob.default BinaryGarbageCollectorgetBinaryGarbageCollector()Gets the associated garbage collector, if any.default BinaryManagergetBinaryManager()Gets the associated binary manager, if any.default 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.default BlobStatusgetStatus(ManagedBlob blob)Gets the status of a blob.default InputStreamgetStream(String blobKey, ByteRange byteRange)Gets 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 booleanhasCreateFromKeyPermission()Checks 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 booleanisColdStorageMode()Checks whether this blob provider uses "cold storage mode".default booleanisRecordMode()Checks whether this blob provider uses "record mode".default booleanisTransactional()Checks whether this blob provider is transactional.default 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.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.BlobreadBlob(BlobInfo blobInfo)Reads aBlobfrom storage.default BlobreadBlob(BlobInfoContext blobInfoContext)Reads aBlobfrom storage.default booleansupportsSync()Checks if sync is supported.booleansupportsUserUpdate()Checks if user update is supported.default voidupdateBlob(BlobUpdateContext blobUpdateContext)Updates a blob's properties in storage.StringwriteBlob(Blob blob)Writes aBlobto storage and returns information about it.default StringwriteBlob(BlobContext blobContext)Writes aBlobto storage and returns information about it.
-
-
-
Method Detail
-
initialize
void initialize(String blobProviderId, Map<String,String> properties) throws IOException
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
default Blob readBlob(BlobInfoContext blobInfoContext) throws IOException
Reads aBlobfrom storage.- Parameters:
blobInfoContext- the blob information context- Returns:
- the blob
- Throws:
IOException- Since:
- 11.1
-
readBlob
Blob readBlob(BlobInfo blobInfo) throws IOException
Reads aBlobfrom storage.- Parameters:
blobInfo- the blob information- Returns:
- the blob
- Throws:
IOException
-
writeBlob
default String writeBlob(BlobContext blobContext) throws IOException
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
String writeBlob(Blob blob) throws IOException
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
default void updateBlob(BlobUpdateContext blobUpdateContext) throws IOException
Updates a blob's properties in storage.- Parameters:
blobUpdateContext- the blob update context- Throws:
IOException- Since:
- 11.1
-
deleteBlob
default void deleteBlob(BlobContext blobContext)
Deletes a blob from storage. Only meaningful for a record blob provider.- Parameters:
blobContext- the blob context- Since:
- 11.1
- See Also:
isRecordMode()
-
getStatus
default BlobStatus getStatus(ManagedBlob blob) throws IOException
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
default InputStream getStream(String blobKey, ByteRange byteRange) throws IOException
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
default InputStream getStream(ManagedBlob blob) throws IOException
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
default File getFile(ManagedBlob blob)
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
default InputStream getThumbnail(ManagedBlob blob) throws IOException
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
default boolean canConvert(ManagedBlob blob, String mimeType)
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
default boolean isVersion(ManagedBlob blob)
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
default List<AppLink> getAppLinks(String user, ManagedBlob blob) throws IOException
Returns a list of application links for the given blob.- Throws:
IOException- Since:
- 7.3
-
getBinaryManager
default BinaryManager getBinaryManager()
Gets the associated binary manager, if any.- Returns:
- the binary manager, or
null - Since:
- 7.4
-
getBinaryGarbageCollector
default BinaryGarbageCollector getBinaryGarbageCollector()
Gets the associated garbage collector, if any.- Returns:
- the garbage collector, or
null - Since:
- 11.1
-
performsExternalAccessControl
default boolean performsExternalAccessControl(BlobInfo blobInfo)
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
Map<String,String> 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
-
-