Class JpaLobStorageService<D extends com.broadleafcommerce.dataimport.provider.jpa.domain.JpaImportLob>
java.lang.Object
com.broadleafcommerce.dataimport.provider.jpa.service.JpaLobStorageService<D>
- All Implemented Interfaces:
StorageService
public class JpaLobStorageService<D extends com.broadleafcommerce.dataimport.provider.jpa.domain.JpaImportLob>
extends Object
implements StorageService
Utilizes Jpa to save and retrieve files for import
TODO this is a stopgap implementation for completeness - it will load the entire file into memory. The long term solution is likely to replace this with a local filesystem-based storage service in the core module.
- Author:
- Chad Harchar (charchar)
-
Constructor Summary
ConstructorDescriptionJpaLobStorageService
(JpaImportLobRepository<D> importLobRepository, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected JpaImportLobRepository<D>
Reads out previously-stored data withStorageService.store(InputStream, String)
void
Deletes the resource at the givenpath
void
store
(InputStream content, String path) Stores a stream to a backing provider, overwriting any data existing at thepath
-
Constructor Details
-
JpaLobStorageService
public JpaLobStorageService(JpaImportLobRepository<D> importLobRepository, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
store
Description copied from interface:StorageService
Stores a stream to a backing provider, overwriting any data existing at thepath
- Specified by:
store
in interfaceStorageService
- Parameters:
content
- the data to storepath
- a path to reference the data by for further operations
-
read
Description copied from interface:StorageService
Reads out previously-stored data withStorageService.store(InputStream, String)
- Specified by:
read
in interfaceStorageService
- Parameters:
path
- the original path that was used to store the file- Returns:
- a stream to the resource or an empty optional if nothing was found at the given
path
-
remove
Description copied from interface:StorageService
Deletes the resource at the givenpath
- Specified by:
remove
in interfaceStorageService
- Parameters:
path
- the path that should be deleted from the store
-
getImportLobRepository
-