public abstract class AbstractCloudBinaryManager extends CachingBinaryManager implements BlobProvider
| Modifier and Type | Field and Description | 
|---|---|
static String | 
CACHE_COUNT_PROPERTY  | 
static String | 
CACHE_MIN_AGE_PROPERTY  | 
static String | 
CACHE_SIZE_PROPERTY  | 
static String | 
DEFAULT_CACHE_COUNT  | 
static String | 
DEFAULT_CACHE_MIN_AGE  | 
static String | 
DEFAULT_CACHE_SIZE  | 
static String | 
DEFAULT_DIRECTDOWNLOAD  | 
static int | 
DEFAULT_DIRECTDOWNLOAD_EXPIRE  | 
protected boolean | 
directDownload  | 
static String | 
DIRECTDOWNLOAD_EXPIRE_PROPERTY  | 
static String | 
DIRECTDOWNLOAD_PROPERTY  | 
protected int | 
directDownloadExpire  | 
protected String | 
namespace  | 
protected Map<String,String> | 
properties  | 
protected boolean | 
transientFlag  | 
cachedir, fileCache, fileStorageblobProviderId, DEFAULT_DEPTH, DEFAULT_DIGEST, descriptor, DIGESTS_BY_LENGTH, garbageCollector, MAX_BUF_SIZE, MD5_DIGEST, MD5_DIGEST_LENGTH, MIN_BUF_SIZE, SHA1_DIGEST, SHA1_DIGEST_LENGTH, SHA256_DIGEST, SHA256_DIGEST_LENGTHPROP_KEY, PROP_PATH| Constructor and Description | 
|---|
AbstractCloudBinaryManager()  | 
| Modifier and Type | Method and Description | 
|---|---|
BinaryManager | 
getBinaryManager()
Gets the associated binary manager, if any. 
 | 
protected boolean | 
getBooleanProperty(String key)
Gets a boolean property. 
 | 
protected String | 
getContentDispositionHeader(Blob blob,
                           javax.servlet.http.HttpServletRequest servletRequest)  | 
protected String | 
getContentTypeHeader(Blob blob)  | 
protected abstract FileStorage | 
getFileStorage()  | 
protected int | 
getIntProperty(String key)
Gets an integer property, or -1 if undefined. 
 | 
Map<String,String> | 
getProperties()
Returns the properties of the blob provider. 
 | 
protected String | 
getProperty(String propertyName)  | 
protected String | 
getProperty(String propertyName,
           String defaultValue)  | 
protected URI | 
getRemoteUri(String digest,
            ManagedBlob blob,
            javax.servlet.http.HttpServletRequest servletRequest)  | 
String | 
getSystemPropertyName(String propertyName)  | 
protected abstract String | 
getSystemPropertyPrefix()
Gets the prefix used for configuration using system properties. 
 | 
URI | 
getURI(ManagedBlob blob,
      BlobManager.UsageHint hint,
      javax.servlet.http.HttpServletRequest servletRequest)
Gets an  
URI for the content of a managed blob. | 
void | 
initialize(String blobProviderId,
          Map<String,String> properties)
Initializes the binary manager. 
 | 
protected abstract BinaryGarbageCollector | 
instantiateGarbageCollector()  | 
protected boolean | 
isDirectDownload()  | 
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. 
 | 
boolean | 
performsExternalAccessControl(BlobInfo blobInfo)
Checks if the blob provider performs external access control checks. 
 | 
Blob | 
readBlob(BlobInfo blobInfo)
Reads a  
Blob from storage. | 
abstract void | 
removeBinaries(Collection<String> digests)
Remove definitively a set of binaries 
 | 
protected abstract void | 
setupCloudClient()
Configure Cloud client using properties 
 | 
boolean | 
supportsUserUpdate()
Checks if user update is supported. 
 | 
protected boolean | 
supportsUserUpdateDefaultTrue()  | 
String | 
writeBlob(Blob blob)
Writes a  
Blob to storage and returns information about it. | 
close, getBinary, getBinary, getFile, initializeCache, initializeCache, initializeCachegetBinary, getDefaultDigestAlgorithm, getDescriptor, getDigestAlgorithm, getGarbageCollector, storeAndDigest, toHexStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcanConvert, close, getAppLinks, getAvailableConversions, getStream, getThumbnail, hasCreateFromKeyPermission, isVersionprotected Map<String,String> properties
protected boolean directDownload
protected int directDownloadExpire
protected boolean transientFlag
public static final String CACHE_SIZE_PROPERTY
public static final String CACHE_COUNT_PROPERTY
public static final String CACHE_MIN_AGE_PROPERTY
public static final String DEFAULT_CACHE_SIZE
public static final String DEFAULT_CACHE_COUNT
public static final String DEFAULT_CACHE_MIN_AGE
public static final String DIRECTDOWNLOAD_PROPERTY
public static final String DEFAULT_DIRECTDOWNLOAD
public static final String DIRECTDOWNLOAD_EXPIRE_PROPERTY
public static final int DEFAULT_DIRECTDOWNLOAD_EXPIRE
public AbstractCloudBinaryManager()
protected abstract String getSystemPropertyPrefix()
protected abstract FileStorage getFileStorage()
protected abstract BinaryGarbageCollector instantiateGarbageCollector()
public abstract void removeBinaries(Collection<String> digests)
BinaryManagerremoveBinaries in interface BinaryManagerremoveBinaries in class AbstractBinaryManagerdigests - a set of digests, must not be null.protected abstract void setupCloudClient() throws IOException
IOExceptionpublic void initialize(String blobProviderId, Map<String,String> properties) throws IOException
BinaryManagerinitialize in interface BinaryManagerinitialize in interface BlobProviderinitialize in class CachingBinaryManagerblobProviderId - the blob provider id for this binary managerproperties - initialization propertiesIOExceptionpublic BinaryManager getBinaryManager()
BlobProvidergetBinaryManager in interface BlobProvidernullpublic Blob readBlob(BlobInfo blobInfo) throws IOException
BlobProviderBlob from storage.readBlob in interface BlobProviderblobInfo - the blob informationIOExceptionpublic String writeBlob(Blob blob) throws IOException
BlobProviderBlob to storage and returns information about it.
 Called to store a user-created blob.
writeBlob in interface BlobProviderblob - the blobIOExceptionpublic boolean performsExternalAccessControl(BlobInfo blobInfo)
BlobProviderperformsExternalAccessControl in interface BlobProviderblobInfo - the blob information to be readtrue if the provider performs security checks before reading a blob, false otherwisepublic boolean supportsUserUpdate()
BlobProviderA 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).
supportsUserUpdate in interface BlobProvidertrue if user update is supportedprotected boolean supportsUserUpdateDefaultTrue()
public URI getURI(ManagedBlob blob, BlobManager.UsageHint hint, javax.servlet.http.HttpServletRequest servletRequest) throws IOException
BlobProviderURI for the content of a managed blob.getURI in interface BlobProviderblob - the managed blobhint - BlobManager.UsageHintservletRequest - the servlet request, or nullURI, or null if none availableIOExceptionprotected boolean isDirectDownload()
protected URI getRemoteUri(String digest, ManagedBlob blob, javax.servlet.http.HttpServletRequest servletRequest) throws IOException
IOExceptionprotected String getProperty(String propertyName)
protected String getProperty(String propertyName, String defaultValue)
protected int getIntProperty(String key)
protected boolean getBooleanProperty(String key)
public String getSystemPropertyName(String propertyName)
protected String getContentTypeHeader(Blob blob)
protected String getContentDispositionHeader(Blob blob, javax.servlet.http.HttpServletRequest servletRequest)
public boolean isTransient()
BlobProviderisTransient in interface BlobProviderpublic Map<String,String> getProperties()
BlobProvidergetProperties in interface BlobProviderCopyright © 2019 Nuxeo. All rights reserved.