Class FilesystemBlobProvider
- All Implemented Interfaces:
BlobProvider
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.
- Since:
- 7.10
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe root ending with /, or an empty string.static final StringFields inherited from class org.nuxeo.ecm.core.blob.AbstractBlobProvider
blobProviderId, properties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this blob provider and releases resources that may be held by it.createBlob(BlobInfo blobInfo) Creates a filesystem blob with the given information.getFile(ManagedBlob blob) Gets aFile(if one exists) for the data of a managed blob.getStream(ManagedBlob blob) Gets anInputStreamfor the data of a managed blob.voidinitialize(String blobProviderId, Map<String, String> properties) Initializes the blob provider.Reads aBlobfrom storage.protected StringstripBlobKeyPrefix(String key) booleanChecks if sync is supported.booleanChecks if user update is supported.Writes aBlobto storage and returns information about it.Methods inherited from class org.nuxeo.ecm.core.blob.AbstractBlobProvider
allowByteRange, getProperties, hasCreateFromKeyPermission, isColdStorageMode, isRecordMode, isTransactional, isTransient, 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
allowDirectDownload, canConvert, deleteBlob, getAppLinks, getAvailableConversions, getBinaryGarbageCollector, getBinaryManager, getStatus, getStream, getThumbnail, getURI, isVersion, performsExternalAccessControl, readBlob, updateBlob, writeBlob
-
Field Details
-
ROOT_PROP
- See Also:
-
root
The root ending with /, or an empty string.
-
-
Constructor Details
-
FilesystemBlobProvider
public FilesystemBlobProvider()
-
-
Method Details
-
initialize
Description copied from interface:BlobProviderInitializes the blob provider.- Specified by:
initializein interfaceBlobProvider- Overrides:
initializein classAbstractBlobProvider- Parameters:
blobProviderId- the blob provider id for this binary managerproperties- initialization properties- Throws:
IOException
-
close
public void close()Description copied from interface:BlobProviderCloses this blob provider and releases resources that may be held by it. -
readBlob
Description copied from interface:BlobProviderReads aBlobfrom storage.- Parameters:
blobInfo- the blob information- Returns:
- the blob
- Throws:
IOException
-
stripBlobKeyPrefix
-
getStream
Description copied from interface:BlobProviderGets 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
-
getFile
Description copied from interface:BlobProviderGets 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
-
supportsUserUpdate
public boolean supportsUserUpdate()Description copied from interface:BlobProviderChecks 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).
- Specified by:
supportsUserUpdatein interfaceBlobProvider- Overrides:
supportsUserUpdatein classAbstractBlobProvider- Returns:
trueif user update is supported
-
supportsSync
public boolean supportsSync()Description copied from interface:BlobProviderChecks 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
-
writeBlob
Description copied from interface:BlobProviderWrites aBlobto storage and returns information about it.Called to store a user-created blob.
- Parameters:
blob- the blob- Returns:
- the blob key
- Throws:
IOException
-
createBlob
Creates a filesystem blob with the given information.The passed
BlobInfocontains information about the blob, and the key is a file path.- Parameters:
blobInfo- the blob info where the key is a file path- Returns:
- the blob
- Throws:
IOException
-