This interface exposes methods required for interacting with an asset storage provider, that is, to store, retrieve, and delete digital content. In other words, this service is responsible for supporting DefaultAssetStorageType#INTERNAL
assets that Broadleaf has access and responsibility to store. It should be implemented for each type of storage provider to be used.
By default, there should only be a single implementation of this service used, meaning that there should only be one storage provider used by the Asset service.
Note this service’s use can be restricted by a MIME type whitelist (see isWhitelistedMimeType(String)
). This means that implementors can restrict what kinds of files can be supported. This method is linked to a system property of the form broadleaf.asset.internal.storageProvider.mimeTypeWhitelist
.
This service can handle creating new resources from either an InputStream
, addResourceFromStream(InputStream, String)
, addResourcesFromStreams(Map)
or by moving files from a temporary workspace moveResourceFromDirectory(File)
moveResourcesFromDirectory(Iterable)
.
Also note that, in the case of failures while processing multiple resources in either the addResourcesFromStreams(Map)
or deleteResources(Iterable)
methods, the default implementation will try to process as many resources as possible before returning a composite exception with all files that failed and their causes (see BulkStorageException
)