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
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprotected String
boolean
Deletes the content from the backing provider.protected JpaDataFeedFileLobRepository<JpaDataFeedFileLob>
boolean
readToDestination
(String uniqueFileNameInContext, String tenantId, OutputStream destination) Reads and transfers the data content of the specified file directly into the specifiedOutputStream
.boolean
store
(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:StorageService
Stores a data stream to a backing provider. The operation will not be successful if there is already data at the specified location.- Specified by:
store
in 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 thecontent
stream 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:StorageService
Reads and transfers the data content of the specified file directly into the specifiedOutputStream
.- Specified by:
readToDestination
in 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:StorageService
Deletes the content from the backing provider.- Specified by:
delete
in 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
-