Class JpaLobStorageService<D extends JpaExportLob>
- java.lang.Object
-
- com.broadleafcommerce.common.dataexport.provider.jpa.service.JpaLobStorageService<D>
-
- All Implemented Interfaces:
StorageService
public class JpaLobStorageService<D extends JpaExportLob> extends Object implements StorageService
Utilizes Jpa to save and retrieve files for export- Author:
- Chad Harchar (charchar)
-
-
Constructor Summary
Constructors Constructor Description JpaLobStorageService(JpaExportLobRepository<D> exportLobRepository, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JpaExportLobRepository<D>getExportLobRepository()Optional<InputStream>read(String path)Reads out previously-stored data withStorageService.store(InputStream, String)voidremove(String path)Deletes the resource at the givenpathvoidstore(InputStream content, String path)Stores a stream to a backing provider, overwriting any data existing at thepath
-
-
-
Constructor Detail
-
JpaLobStorageService
public JpaLobStorageService(JpaExportLobRepository<D> exportLobRepository, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Detail
-
store
public void store(InputStream content, String path)
Description copied from interface:StorageServiceStores a stream to a backing provider, overwriting any data existing at thepath- Specified by:
storein interfaceStorageService- Parameters:
content- the data to storepath- a path to reference the data by for further operations
-
read
@Transactional public Optional<InputStream> read(String path)
Description copied from interface:StorageServiceReads out previously-stored data withStorageService.store(InputStream, String)- Specified by:
readin 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
public void remove(String path)
Description copied from interface:StorageServiceDeletes the resource at the givenpath- Specified by:
removein interfaceStorageService- Parameters:
path- the path that should be deleted from the store
-
getExportLobRepository
@NonNull protected JpaExportLobRepository<D> getExportLobRepository()
-
-