Class DefaultFilesystemContentResolver
- All Implemented Interfaces:
ContentResolverService
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 Summary
FieldsModifier and TypeFieldDescriptionprotected final AssetStorageUtilsDeprecated, for removal: This API element is subject to removal in a future version. -
Constructor Summary
ConstructorsConstructorDescriptionDefaultFilesystemContentResolver(StorageProvider storageProvider, ImageOperationService imageOperationService) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcreateImageEffectsUrl(String url, org.springframework.util.MultiValueMap<String, String> imageEffectsTags) Deprecated, for removal: This API element is subject to removal in a future version.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 usedOptional<org.springframework.core.io.Resource>readResource(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.This method will accept a URL and then return a handle to stream the resource from theStorageProvider.readResourceWithMetadata(@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.This method will accept a URL and then return a handle to stream the resource from theStorageProvider.
-
Field Details
-
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: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:
readResourcein 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 theResource, orOptional.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: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
-
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.
-
DefaultContentResolver