Class ContentResolverEndpoint

java.lang.Object
com.broadleafcommerce.asset.web.endpoint.ContentResolverEndpoint

@FrameworkRestController @FrameworkMapping({"${broadleaf.asset.internal.contentResolverEndpointPath}/**","${broadleaf.asset.internal.content-resolver-endpoint-path}/**"}) @DataRouteByExample(Asset.class) public class ContentResolverEndpoint extends Object
Author:
Samarth Dhruva (samarthd)
  • Field Details

  • Constructor Details

    • ContentResolverEndpoint

      public ContentResolverEndpoint(ContentResolverService contentResolverService, InternalAssetProperties internalAssetProperties, AssetService<Asset> service, jakarta.activation.FileTypeMap mimeFileTypeMap, com.broadleafcommerce.data.tracking.core.tenant.service.CommonApplicationService<com.broadleafcommerce.data.tracking.core.tenant.domain.Application> applicationService)
  • Method Details

    • init

      @PostConstruct public void init()
    • getInitUrlPathHelper

      protected void getInitUrlPathHelper()
    • getResource

      @FrameworkGetMapping public org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> getResource(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @RequestParam(required=false) org.springframework.util.MultiValueMap<String,String> imageEffectsTags, jakarta.servlet.http.HttpServletRequest request)
    • getContextInfoFromRequest

      protected com.broadleafcommerce.data.tracking.core.context.ContextInfo getContextInfoFromRequest(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, jakarta.servlet.http.HttpServletRequest request)
      Check if the contextInfo passed in is missing any relevant information. If so, try to resolve the current application based on the request that came in.
      Parameters:
      contextInfo - the context of the request
      request - the actual request that is being consumed
      Returns:
      either the original contextInfo or a new one based on the resolved application
    • stripEndpointPrefix

      protected String stripEndpointPrefix(jakarta.servlet.http.HttpServletRequest request)
    • applyBrowserCachingHeaders

      protected void applyBrowserCachingHeaders(org.springframework.http.ResponseEntity.BodyBuilder responseBuilder)
    • getCacheControl

      protected org.springframework.http.CacheControl getCacheControl()
    • getBackwardsCompatibleCachingHeaders

      protected org.springframework.http.HttpHeaders getBackwardsCompatibleCachingHeaders()
    • handleResourceResolutionException

      @ExceptionHandler(ResourceResolutionException.class) public org.springframework.http.ResponseEntity<com.broadleafcommerce.common.error.ApiError> handleResourceResolutionException(ResourceResolutionException ex, org.springframework.web.context.request.WebRequest request)
    • logDebug

      protected void logDebug(Exception ex, org.springframework.web.context.request.WebRequest request)
    • applyContentDisposition

      @Deprecated(since="2.1.0", forRemoval=true) protected void applyContentDisposition(org.springframework.core.io.Resource resource, org.springframework.http.ResponseEntity.BodyBuilder responseBuilder, Asset asset)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • applyContentDisposition

      protected void applyContentDisposition(ResourceWithMetadata resourceWithMetadata, org.springframework.http.ResponseEntity.BodyBuilder responseBuilder, Asset asset)
    • getContentResolverService

      protected ContentResolverService getContentResolverService()
    • getService

      protected AssetService<Asset> getService()
    • getMimeFileTypeMap

      @NonNull protected jakarta.activation.FileTypeMap getMimeFileTypeMap()
    • getApplicationService

      protected com.broadleafcommerce.data.tracking.core.tenant.service.CommonApplicationService<com.broadleafcommerce.data.tracking.core.tenant.domain.Application> getApplicationService()
    • setTypeFactory

      @Autowired public void setTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()