Package org.nuxeo.ecm.blob.s3
Class S3BlobProvider
java.lang.Object
org.nuxeo.ecm.core.blob.AbstractBlobProvider
org.nuxeo.ecm.core.blob.BlobStoreBlobProvider
org.nuxeo.ecm.blob.s3.S3BlobProvider
- All Implemented Interfaces:
S3ManagedTransfer,BlobProvider
Blob provider that stores files in S3.
This blob provider supports transactional record mode.
- Since:
- 11.1
-
Nested Class Summary
Nested classes/interfaces inherited from class org.nuxeo.ecm.core.blob.BlobStoreBlobProvider
BlobStoreBlobProvider.AutoDeleteFileInputStream -
Field Summary
FieldsFields inherited from class org.nuxeo.ecm.core.blob.BlobStoreBlobProvider
DIGEST_KEY_STRATEGY, KEY_STRATEGY_PROPERTY, MANAGED_KEY_STRATEGY, storeFields inherited from class org.nuxeo.ecm.core.blob.AbstractBlobProvider
blobProviderId, properties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether this blob provider allows direct download.booleanChecks if the bucket exists (used in health check probes).voidclose()Closes this blob provider and releases resources that may be held by it.protected BlobStoregetBlobStore(String blobProviderId, Map<String, String> properties) protected S3BlobStoreConfigurationgetConfiguration(Map<String, String> properties) protected StringgetContentDispositionHeader(Blob blob, javax.servlet.http.HttpServletRequest servletRequest) protected StringgetContentTypeHeader(Blob blob) protected StringThe digest algorithm to use for the default key strategy.getStatus(ManagedBlob blob) Gets the status of a blob.Gets the name of the scroll to scroll the blobs of the underlying blob store.com.amazonaws.services.s3.transfer.TransferManagerReturns theTransferManager.getURI(ManagedBlob blob, BlobManager.UsageHint hint, javax.servlet.http.HttpServletRequest servletRequest) Gets anURIfor the content of a managed blob.protected URIgetURICloudFront(String bucketKey, ManagedBlob blob, Date expiration, javax.servlet.http.HttpServletRequest servletRequest) protected URIgetURIS3(String bucketKey, ManagedBlob blob, Date expiration, javax.servlet.http.HttpServletRequest servletRequest) longlengthOfBlob(ManagedBlob blob) Gets the blob length from the underlying s3 bucket.Methods inherited from class org.nuxeo.ecm.core.blob.BlobStoreBlobProvider
deleteBlob, fixupDigest, getBinaryGarbageCollector, getFile, getKeyStrategy, getStream, getStream, initialize, isValidKey, readBlob, stripBlobKeyPrefix, stripBlobKeyVersionSuffix, supportsSync, updateBlob, writeBlob, writeBlobMethods inherited from class org.nuxeo.ecm.core.blob.AbstractBlobProvider
allowByteRange, getProperties, hasCreateFromKeyPermission, isColdStorageMode, isRecordMode, isTransactional, isTransient, supportsUserUpdate, supportsUserUpdateDefaultFalse, supportsUserUpdateDefaultTrueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.ecm.core.blob.BlobProvider
canConvert, getAppLinks, getAvailableConversions, getBinaryManager, getThumbnail, isVersion, performsExternalAccessControl, readBlob
-
Field Details
-
STORE_SCROLL_NAME
- Since:
- 2023
- See Also:
-
config
-
-
Constructor Details
-
S3BlobProvider
public S3BlobProvider()
-
-
Method Details
-
getBlobStore
protected BlobStore getBlobStore(String blobProviderId, Map<String, String> properties) throws IOException- Specified by:
getBlobStorein classBlobStoreBlobProvider- Throws:
IOException
-
allowDirectDownload
public boolean allowDirectDownload()Description copied from interface:BlobProviderChecks whether this blob provider allows direct download.- Specified by:
allowDirectDownloadin interfaceBlobProvider- Overrides:
allowDirectDownloadin classBlobStoreBlobProvider- Since:
- 2023.12
-
getConfiguration
protected S3BlobStoreConfiguration getConfiguration(Map<String, String> properties) throws IOException- Throws:
IOException
-
getTransferManager
public com.amazonaws.services.s3.transfer.TransferManager getTransferManager()Description copied from interface:S3ManagedTransferReturns theTransferManager.- Specified by:
getTransferManagerin interfaceS3ManagedTransfer
-
close
public void close()Description copied from interface:BlobProviderCloses this blob provider and releases resources that may be held by it.- Specified by:
closein interfaceBlobProvider
-
getDigestAlgorithm
Description copied from class:BlobStoreBlobProviderThe digest algorithm to use for the default key strategy.- Specified by:
getDigestAlgorithmin classBlobStoreBlobProvider
-
canAccessBucket
public boolean canAccessBucket()Checks if the bucket exists (used in health check probes). -
lengthOfBlob
Gets the blob length from the underlying s3 bucket.- Returns:
- the blob length or -1 if the blob does not exist in storage
- Throws:
IOException- Since:
- 2023.9
-
getURI
public URI getURI(ManagedBlob blob, BlobManager.UsageHint hint, javax.servlet.http.HttpServletRequest servletRequest) throws IOException Description copied from interface:BlobProviderGets anURIfor the content of a managed blob.- Specified by:
getURIin interfaceBlobProvider- Parameters:
blob- the managed blobhint-BlobManager.UsageHintservletRequest- the servlet request, ornull- Returns:
- the
URI, ornullif none available - Throws:
IOException
-
getURICloudFront
protected URI getURICloudFront(String bucketKey, ManagedBlob blob, Date expiration, javax.servlet.http.HttpServletRequest servletRequest) throws URISyntaxException - Throws:
URISyntaxException
-
getURIS3
protected URI getURIS3(String bucketKey, ManagedBlob blob, Date expiration, javax.servlet.http.HttpServletRequest servletRequest) throws URISyntaxException - Throws:
URISyntaxException
-
getContentTypeHeader
-
getContentDispositionHeader
-
getStatus
Description copied from interface:BlobProviderGets the status of a blob.- Specified by:
getStatusin interfaceBlobProvider- Parameters:
blob- the blob- Throws:
IOException
-
getStoreScrollName
Description copied from class:BlobStoreBlobProviderGets the name of the scroll to scroll the blobs of the underlying blob store.- Specified by:
getStoreScrollNamein classBlobStoreBlobProvider
-