Class DefaultContentResolver
java.lang.Object
com.broadleafcommerce.asset.storage.provider.service.DefaultContentResolver
- All Implemented Interfaces:
ContentResolverService
Default implementation of ContentResolverService. It uses StorageProvider to read
the resources for the Assets.
- Author:
- Samarth Dhruva (samarthd)
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultContentResolver(StorageProvider storageProvider, ImageOperationService imageOperationService, AssetStorageUtils assetStorageUtils) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcreateImageEffectsUrl(String url, org.springframework.util.MultiValueMap<String, String> imageEffectsTags) protected <R> RdoWithoutCache(Supplier<R> returningWork) protected AssetStorageUtilsprotected ImageOperationServiceprotected StorageProviderreadResourceWithMetadata(@NonNull String url, org.springframework.util.MultiValueMap<String, String> imageEffectsTags, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) This method will accept a URL and then return a handle to stream the resource from theStorageProvider.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.asset.storage.provider.service.ContentResolverService
readResource
-
Constructor Details
-
DefaultContentResolver
public DefaultContentResolver(StorageProvider storageProvider, ImageOperationService imageOperationService, AssetStorageUtils assetStorageUtils)
-
-
Method Details
-
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) Description copied from interface:ContentResolverServiceThis 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:
readResourceWithMetadatain interfaceContentResolverService- Parameters:
url- the URL of the digital content to fetchimageEffectsTags- 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
Optionalcontaining theResourceWithMetadata, orOptional.empty()if not found
-
doWithoutCache
-
createImageEffectsUrl
-
getStorageProvider
-
getImageOperationService
-
getAssetStorageUtils
-