Class LocalMediaWebURLStrategy

java.lang.Object
de.hybris.platform.media.url.impl.LocalMediaWebURLStrategy
All Implemented Interfaces:
MediaURLStrategy

public class LocalMediaWebURLStrategy extends Object implements MediaURLStrategy
Url strategy for local mediaweb. Renders URLs in following format:
 /medias/realFilename.jpg?context=base32encodedMediaContext
 
Spring Bean ID:
= localMediaWebURLStrategy
  • Field Details

  • Constructor Details

    • LocalMediaWebURLStrategy

      public LocalMediaWebURLStrategy()
  • Method Details

    • getUrlForMedia

      public String getUrlForMedia(MediaStorageConfigService.MediaFolderConfig config, MediaSource mediaSource)
      Description copied from interface: MediaURLStrategy
      Gets specific public URL for media binary data.
      Specified by:
      getUrlForMedia in interface MediaURLStrategy
      Parameters:
      config - media folder configuration
      mediaSource - the wrapper which wraps real Media object
      Returns:
      the URL for media
    • getMediaWebRootContext

      public String getMediaWebRootContext()
      Returns media web app context root, e.g. '/medias'
    • getTenantId

      protected String getTenantId()
    • getDownloadUrlForMedia

      public String getDownloadUrlForMedia(MediaStorageConfigService.MediaFolderConfig config, MediaSource mediaSource)
      Gets the download URL for media. URL contains parameter attachment with value true. This parameter causes that MediaFilter add Content-Disposition header to the HTTP response what forces browser to display download dialog rather than serve media directly.
      Parameters:
      config - media folder configuration
      mediaSource - the media source
      Returns:
      the download URL for media
    • isPrettyUrlEnabled

      protected boolean isPrettyUrlEnabled()
    • setPrettyUrlEnabled

      public void setPrettyUrlEnabled(boolean prettyUrlEnabled)