Class JpaDataFeedFileLobStorageService
java.lang.Object
com.broadleafcommerce.datafeed.provider.jpa.service.JpaDataFeedFileLobStorageService
- All Implemented Interfaces:
StorageService
An implementation of
StorageService that leverages JpaDataFeedFileLob as the file
storage mechanism.-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprotected StringbooleanDeletes the content from the backing provider.protected JpaDataFeedFileLobRepository<JpaDataFeedFileLob>booleanreadToDestination(String uniqueFileNameInContext, String tenantId, OutputStream destination) Reads and transfers the data content of the specified file directly into the specifiedOutputStream.booleanstore(String uniqueFileNameInContext, InputStream content, long contentSizeInBytes, String tenantId) Stores a data stream to a backing provider.
-
Constructor Details
-
JpaDataFeedFileLobStorageService
public JpaDataFeedFileLobStorageService(JpaDataFeedFileLobRepository<JpaDataFeedFileLob> repository)
-
-
Method Details
-
store
public boolean store(String uniqueFileNameInContext, InputStream content, long contentSizeInBytes, String tenantId) Description copied from interface:StorageServiceStores a data stream to a backing provider. The operation will not be successful if there is already data at the specified location.- Specified by:
storein interfaceStorageService- Parameters:
uniqueFileNameInContext- a file name to uniquely identify the file in the given context (ex: unique in the given tenant)content- the data to store. This will always be closed by the implementation.contentSizeInBytes- the size of thecontentstream in bytestenantId- the tenant ID to store the file under- Returns:
- whether the operation was successful
-
buildPath
-
readToDestination
public boolean readToDestination(String uniqueFileNameInContext, String tenantId, OutputStream destination) Description copied from interface:StorageServiceReads and transfers the data content of the specified file directly into the specifiedOutputStream.- Specified by:
readToDestinationin interfaceStorageService- Parameters:
uniqueFileNameInContext- a file name to uniquely identify the file in the given context (ex: unique in the given tenant)tenantId- the tenant ID the file is stored underdestination- the destination to write the data to. This will always be closed by the implementation.- Returns:
- whether the operation was successful
-
delete
Description copied from interface:StorageServiceDeletes the content from the backing provider.- Specified by:
deletein interfaceStorageService- Parameters:
uniqueFileNameInContext- a file name to uniquely identify the file in the given context (ex: unique in the given tenant)tenantId- the tenant ID the file is stored under- Returns:
- whether the operation was successful
-
getRepository
-