Class LocalMediaWebURLStrategy
java.lang.Object
de.hybris.platform.media.url.impl.LocalMediaWebURLStrategy
- All Implemented Interfaces:
MediaURLStrategy
Url strategy for local mediaweb. Renders URLs in following format:
/medias/realFilename.jpg?context=base32encodedMediaContext
- Spring Bean ID:
- = localMediaWebURLStrategy
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDownloadUrlForMedia(MediaStorageConfigService.MediaFolderConfig config, MediaSource mediaSource) Gets the download URL for media.Returns media web app context root, e.g.protected StringgetUrlForMedia(MediaStorageConfigService.MediaFolderConfig config, MediaSource mediaSource) Gets specific public URL for media binary data.protected booleanvoidsetPrettyUrlEnabled(boolean prettyUrlEnabled)
-
Field Details
-
CONTEXT_PARAM_DELIM
- See Also:
-
NO_CTX_PART_MARKER
- See Also:
-
CONTEXT_PARAM
- See Also:
-
ATTACHEMENT_PARAM
- See Also:
-
MEDIA_LEGACY_PRETTY_URL
- See Also:
-
PRETTY_URL_TENANT_PREFIX
- See Also:
-
URL_SEPARATOR
- See Also:
-
-
Constructor Details
-
LocalMediaWebURLStrategy
public LocalMediaWebURLStrategy()
-
-
Method Details
-
getUrlForMedia
public 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
Returns media web app context root, e.g. '/medias' -
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 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
-
isPrettyUrlEnabled
protected boolean isPrettyUrlEnabled() -
setPrettyUrlEnabled
public void setPrettyUrlEnabled(boolean prettyUrlEnabled)
-