Class MockAssetDelivery

java.lang.Object
io.wcm.testing.mock.aem.dam.ngdm.MockAssetDelivery
All Implemented Interfaces:
com.adobe.cq.wcm.spi.AssetDelivery

public final class MockAssetDelivery extends Object implements com.adobe.cq.wcm.spi.AssetDelivery
Mock implementation of AssetDelivery for Web-Optimized Image Delivery.

As Asset ID a md5 hash of the path is used.

This OSGi service is not registered by default in AEM Mocks, as it is not available in all contexts (e.g. not in AEM 6.5 and AEMaaCS SDK).

  • Constructor Details

    • MockAssetDelivery

      public MockAssetDelivery()
  • Method Details

    • getDeliveryURL

      @Nullable public @Nullable String getDeliveryURL(@NotNull @NotNull org.apache.sling.api.resource.Resource resource, @Nullable @Nullable Map<String,Object> parameterMap)
      Specified by:
      getDeliveryURL in interface com.adobe.cq.wcm.spi.AssetDelivery
    • getAssetId

      public static String getAssetId(@NotNull @NotNull com.day.cq.dam.api.Asset asset)
      Generate Asset ID for given asset.
      Parameters:
      asset - Asset
      Returns:
      MD5 hash of asset path
    • getAssetId

      public static String getAssetId(@NotNull @NotNull String path)
      Generate Asset ID for given path.
      Parameters:
      path - Asset path
      Returns:
      MD5 hash of asset path