Class LocalMediaWebURLStrategy

  • All Implemented Interfaces:
    MediaURLStrategy

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

      • CONTEXT_PARAM_DELIM

        public static final java.lang.String CONTEXT_PARAM_DELIM
        See Also:
        Constant Field Values
      • NO_CTX_PART_MARKER

        public static final java.lang.String NO_CTX_PART_MARKER
        See Also:
        Constant Field Values
      • ATTACHEMENT_PARAM

        public static final java.lang.String ATTACHEMENT_PARAM
        See Also:
        Constant Field Values
      • MEDIA_LEGACY_PRETTY_URL

        public static final java.lang.String MEDIA_LEGACY_PRETTY_URL
        See Also:
        Constant Field Values
      • PRETTY_URL_TENANT_PREFIX

        public static final java.lang.String PRETTY_URL_TENANT_PREFIX
        See Also:
        Constant Field Values
    • Constructor Detail

      • LocalMediaWebURLStrategy

        public LocalMediaWebURLStrategy()
    • Method Detail

      • getMediaWebRootContext

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

        protected java.lang.String getTenantId()
      • getDownloadUrlForMedia

        public java.lang.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
      • setPrettyUrlEnabled

        public void setPrettyUrlEnabled​(boolean prettyUrlEnabled)