Class JpaDataFeedFileLobStorageService

java.lang.Object
com.broadleafcommerce.datafeed.provider.jpa.service.JpaDataFeedFileLobStorageService
All Implemented Interfaces:
StorageService

public class JpaDataFeedFileLobStorageService extends Object implements StorageService
An implementation of StorageService that leverages JpaDataFeedFileLob as the file storage mechanism.
  • Constructor Details

  • 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 interface StorageService
      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 the content stream in bytes
      tenantId - the tenant ID to store the file under
      Returns:
      whether the operation was successful
    • buildPath

      protected String buildPath(String uniqueFilenameInContext, String tenantId)
    • 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 specified OutputStream.
      Specified by:
      readToDestination in interface StorageService
      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
      destination - the destination to write the data to. This will always be closed by the implementation.
      Returns:
      whether the operation was successful
    • delete

      public boolean delete(String uniqueFileNameInContext, String tenantId)
      Description copied from interface: StorageService
      Deletes the content from the backing provider.
      Specified by:
      delete in interface StorageService
      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