public interface MediaStorageStrategy
Media object is stored in
media storage which could be any storage like for instance file system, disk share, FTP. Binary data is identified by
its unique location string identifier. After storing binary data by using
store(de.hybris.platform.media.storage.MediaStorageConfigService.MediaFolderConfig, java.lang.String, java.util.Map, java.io.InputStream)
StoreMediaData object is returned which contains all required informations: unique location string
identifier, size and hash for location. All other operations like: delete, get can be performed by using unique
location string identifier.| Modifier and Type | Method and Description |
|---|---|
void |
delete(MediaStorageConfigService.MediaFolderConfig config,
java.lang.String location)
Delete media represented by location from the storage.
|
java.io.File |
getAsFile(MediaStorageConfigService.MediaFolderConfig config,
java.lang.String location)
Gets the media data from the storage as file.
|
java.io.InputStream |
getAsStream(MediaStorageConfigService.MediaFolderConfig config,
java.lang.String location)
Gets the media data from the storage as stream.
|
long |
getSize(MediaStorageConfigService.MediaFolderConfig config,
java.lang.String location)
Gets size of media data in bytes.
|
StoredMediaData |
store(MediaStorageConfigService.MediaFolderConfig config,
java.lang.String mediaId,
java.util.Map<java.lang.String,java.lang.Object> metaData,
java.io.InputStream dataStream)
Stores media data into the storage using unique location identifier.
|
StoredMediaData store(MediaStorageConfigService.MediaFolderConfig config, java.lang.String mediaId, java.util.Map<java.lang.String,java.lang.Object> metaData, java.io.InputStream dataStream)
mediaId as unique part. mediaId is generated by platform for each upload attempt so it
guarantees uniqueness.config - media folder configurationmediaId - the media identifiermetaData - the meta data containing additional possible informations like: original filename, MIME, folder pathdataStream - the data stream to storeMediaStoreException - when media stream cannot be stored in storagevoid delete(MediaStorageConfigService.MediaFolderConfig config, java.lang.String location)
config - media folder configurationlocation - the string representation of location of media data in storageMediaRemovalException - if delete operation in the storage has failedjava.io.InputStream getAsStream(MediaStorageConfigService.MediaFolderConfig config, java.lang.String location)
config - media folder configurationlocation - the string representation of location of media data in storageMediaNotFoundException - when media does not exist in the storagejava.io.File getAsFile(MediaStorageConfigService.MediaFolderConfig config, java.lang.String location)
config - media folder configurationlocation - the string representation of location of media data in storagejava.lang.UnsupportedOperationException - when particular implementation does not support returning data as Filelong getSize(MediaStorageConfigService.MediaFolderConfig config, java.lang.String location)
config - media folder configurationlocation - the string representation of location of media data in storageMediaNotFoundException - when media does not exist in the storageCopyright © 2018 SAP SE. All Rights Reserved.