Class LocalMediaWebURLStrategy
- java.lang.Object
-
- de.hybris.platform.media.url.impl.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 Summary
Fields Modifier and Type Field Description static java.lang.StringATTACHEMENT_PARAMstatic java.lang.StringCONTEXT_PARAMstatic java.lang.StringCONTEXT_PARAM_DELIMstatic java.lang.StringMEDIA_LEGACY_PRETTY_URLstatic java.lang.StringNO_CTX_PART_MARKERstatic java.lang.StringPRETTY_URL_TENANT_PREFIX
-
Constructor Summary
Constructors Constructor Description LocalMediaWebURLStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDownloadUrlForMedia(MediaStorageConfigService.MediaFolderConfig config, MediaSource mediaSource)Gets the download URL for media.java.lang.StringgetMediaWebRootContext()Returns media web app context root, e.g.protected java.lang.StringgetTenantId()java.lang.StringgetUrlForMedia(MediaStorageConfigService.MediaFolderConfig config, MediaSource mediaSource)Gets specific public URL for media binary data.voidsetPrettyUrlEnabled(boolean prettyUrlEnabled)
-
-
-
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
-
CONTEXT_PARAM
public static final java.lang.String CONTEXT_PARAM
- 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
-
-
Method Detail
-
getUrlForMedia
public java.lang.String getUrlForMedia(MediaStorageConfigService.MediaFolderConfig config, MediaSource mediaSource)
Description copied from interface:MediaURLStrategyGets specific public URL for media binary data.- Specified by:
getUrlForMediain interfaceMediaURLStrategy- Parameters:
config- media folder configurationmediaSource- the wrapper which wraps real Media object- Returns:
- the URL for media
-
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 thatMediaFilteradd Content-Disposition header to the HTTP response what forces browser to display download dialog rather than serve media directly.- Parameters:
config- media folder configurationmediaSource- the media source- Returns:
- the download URL for media
-
setPrettyUrlEnabled
public void setPrettyUrlEnabled(boolean prettyUrlEnabled)
-
-