public class FilesystemBlobProvider extends AbstractBlobProvider
This blob provider MUST be configured with a "root" property that specifies the minimum root path for all files:
<blobprovider name="myfsblobprovider">
<class>org.nuxeo.ecm.core.blob.FilesystemBlobProvider</class>
<property name="root">/base/directory/for/files</property>
</blobprovider>
A root of / may be used to allow any path.
Blobs are constructed through createBlob(org.nuxeo.ecm.core.blob.BlobInfo). The constructed blob's key, which will be
stored in the document database, contains a path relative to the root.
| Modifier and Type | Field and Description |
|---|---|
protected String |
root
The root ending with /, or an empty string.
|
static String |
ROOT_PROP |
blobProviderId, properties| Constructor and Description |
|---|
FilesystemBlobProvider() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this blob provider and releases resources that may be held by it.
|
ManagedBlob |
createBlob(BlobInfo blobInfo)
Creates a filesystem blob with the given information.
|
InputStream |
getStream(ManagedBlob blob)
Gets an
InputStream for the data of a managed blob. |
void |
initialize(String blobProviderId,
Map<String,String> properties)
Initializes the blob provider.
|
Blob |
readBlob(BlobInfo blobInfo)
Reads a
Blob from storage. |
boolean |
supportsUserUpdate()
Checks if user update is supported.
|
String |
writeBlob(Blob blob)
Writes a
Blob to storage and returns information about it. |
supportsUserUpdateDefaultFalse, supportsUserUpdateDefaultTrueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAppLinks, getAvailableConversions, getBinaryManager, getThumbnail, getURI, isVersion, performsExternalAccessControlpublic static final String ROOT_PROP
public FilesystemBlobProvider()
public void initialize(String blobProviderId, Map<String,String> properties) throws IOException
BlobProviderinitialize in interface BlobProviderinitialize in class AbstractBlobProviderblobProviderId - the blob provider id for this binary managerproperties - initialization propertiesIOExceptionpublic void close()
BlobProviderpublic Blob readBlob(BlobInfo blobInfo) throws IOException
BlobProviderBlob from storage.blobInfo - the blob informationIOExceptionpublic InputStream getStream(ManagedBlob blob) throws IOException
BlobProviderInputStream for the data of a managed blob.
Like all InputStream, the result must be closed when done with it to avoid resource leaks.
blob - the managed blobIOExceptionpublic 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 BlobProvidersupportsUserUpdate in class AbstractBlobProvidertrue if user update is supportedpublic String writeBlob(Blob blob) throws IOException
BlobProviderBlob to storage and returns information about it.
Called to store a user-created blob.
blob - the blobIOExceptionpublic ManagedBlob createBlob(BlobInfo blobInfo) throws IOException
The passed BlobInfo contains information about the blob, and the key is a file path.
blobInfo - the blob info where the key is a file pathIOExceptionCopyright © 2018 Nuxeo. All rights reserved.