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
public class S3BlobProvider extends BlobStoreBlobProvider implements S3ManagedTransfer
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
Fields Modifier and Type Field Description S3BlobStoreConfigurationconfig-
Fields inherited from class org.nuxeo.ecm.core.blob.BlobStoreBlobProvider
DIGEST_KEY_STRATEGY, KEY_STRATEGY_PROPERTY, MANAGED_KEY_STRATEGY, store
-
Fields inherited from class org.nuxeo.ecm.core.blob.AbstractBlobProvider
blobProviderId, properties
-
-
Constructor Summary
Constructors Constructor Description S3BlobProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanAccessBucket()Checks 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)protected StringgetContentTypeHeader(Blob blob)protected StringgetDigestAlgorithm()The digest algorithm to use for the default key strategy.BlobStatusgetStatus(ManagedBlob blob)Gets the status of a blob.com.amazonaws.services.s3.transfer.TransferManagergetTransferManager()Returns theTransferManager.URIgetURI(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)protected URIgetURIS3(String bucketKey, ManagedBlob blob, Date expiration)-
Methods inherited from class org.nuxeo.ecm.core.blob.BlobStoreBlobProvider
deleteBlob, fixupDigest, getBinaryGarbageCollector, getBinaryManager, getFile, getKeyStrategy, getStream, getStream, initialize, readBlob, stripBlobKeyPrefix, supportsSync, updateBlob, writeBlob, writeBlob
-
Methods inherited from class org.nuxeo.ecm.core.blob.AbstractBlobProvider
allowByteRange, getProperties, hasCreateFromKeyPermission, isRecordMode, isTransactional, isTransient, supportsUserUpdate, supportsUserUpdateDefaultFalse, supportsUserUpdateDefaultTrue
-
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
canConvert, getAppLinks, getAvailableConversions, getThumbnail, isVersion, performsExternalAccessControl, readBlob
-
-
-
-
Field Detail
-
config
public S3BlobStoreConfiguration config
-
-
Constructor Detail
-
S3BlobProvider
public S3BlobProvider()
-
-
Method Detail
-
getBlobStore
protected BlobStore getBlobStore(String blobProviderId, Map<String,String> properties) throws IOException
- Specified by:
getBlobStorein classBlobStoreBlobProvider- Throws:
IOException
-
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
protected String 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).
-
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) throws URISyntaxException
- Throws:
URISyntaxException
-
getURIS3
protected URI getURIS3(String bucketKey, ManagedBlob blob, Date expiration) throws URISyntaxException
- Throws:
URISyntaxException
-
getContentTypeHeader
protected String getContentTypeHeader(Blob blob)
-
getContentDispositionHeader
protected String getContentDispositionHeader(Blob blob)
-
getStatus
public BlobStatus getStatus(ManagedBlob blob) throws IOException
Description copied from interface:BlobProviderGets the status of a blob.- Specified by:
getStatusin interfaceBlobProvider- Parameters:
blob- the blob- Throws:
IOException
-
-