Class DefaultFilesystemContentResolver

java.lang.Object
com.broadleafcommerce.asset.storage.provider.service.DefaultFilesystemContentResolver
All Implemented Interfaces:
ContentResolverService

@Deprecated(since="2.0.1", forRemoval=true) public class DefaultFilesystemContentResolver extends Object implements ContentResolverService
Deprecated, for removal: This API element is subject to removal in a future version.
this service works not only with the Filesystem storage, so it was renamed to DefaultContentResolver

Default implementation of ContentResolverService specifically designed to work with the local/shared filesystem to read out the files of requested assets of Asset.

This ContentResolverService can only be used in production systems that run on a single server or those that have a shared filesystem mounted to the application servers.
Author:
Samarth Dhruva (samarthd)
  • Field Details

    • assetStorageUtils

      protected final AssetStorageUtils assetStorageUtils
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • DefaultFilesystemContentResolver

      public DefaultFilesystemContentResolver(StorageProvider storageProvider, ImageOperationService imageOperationService)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • readResource

      public Optional<org.springframework.core.io.Resource> readResource(@NonNull String url, org.springframework.util.MultiValueMap<String,String> imageEffectsTags, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: ContentResolverService

      This method will accept a URL and then return a handle to stream the resource from the StorageProvider.

      If the content is requested with certain effects applied, the method will search for a cached copy of the content with those effects applied. If no cached copy is found, then the base content is retrieved, the effects are applied to it, the modified version is cached in the storage provider, and then returned. Of course, if the base content is not found, this method will simply return an Optional.empty().

      Specified by:
      readResource in interface ContentResolverService
      Parameters:
      url - the URL of the digital content to fetch
      imageEffectsTags - the image effects tags to apply to the content; a map of effects to their values.
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      an Optional containing the Resource, or Optional.empty() if not found
    • readResourceWithMetadata

      public Optional<ResourceWithMetadata> readResourceWithMetadata(@NonNull @NonNull String url, @Nullable org.springframework.util.MultiValueMap<String,String> imageEffectsTags, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: ContentResolverService

      This method will accept a URL and then return a handle to stream the resource from the StorageProvider.

      If the content is requested with certain effects applied, the method will search for a cached copy of the content with those effects applied. If no cached copy is found, then the base content is retrieved, the effects are applied to it, the modified version is cached in the storage provider, and then returned. Of course, if the base content is not found, this method will simply return an Optional.empty().

      Specified by:
      readResourceWithMetadata in interface ContentResolverService
      Parameters:
      url - the URL of the digital content to fetch
      imageEffectsTags - the image effects tags to apply to the content; a map of effects to their values.
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      an Optional containing the ResourceWithMetadata, or Optional.empty() if not found
    • getFileAsResource

      @Deprecated(since="2.0.1", forRemoval=true) protected Optional<org.springframework.core.io.Resource> getFileAsResource(File file)
      Deprecated, for removal: This API element is subject to removal in a future version.
      this method is no longer used
    • createImageEffectsUrl

      protected String createImageEffectsUrl(String url, org.springframework.util.MultiValueMap<String,String> imageEffectsTags)
      Deprecated, for removal: This API element is subject to removal in a future version.