@Singleton public class ResourceLinker extends Object
ResourceOrigin
and generate links to them. Specifically,
it handles prefixing links with context path, site prefix if needed, and the fingerprinting.Constructor and Description |
---|
ResourceLinker(info.magnolia.resourceloader.ResourceOrigin origin,
javax.inject.Provider<ResourcesModule> configuration,
javax.inject.Provider<info.magnolia.cms.core.AggregationState> aggregationStateProvider,
info.magnolia.templating.functions.TemplatingFunctions templatingFunctions) |
Modifier and Type | Method and Description |
---|---|
protected String |
cleanDownloadPath()
Returns whatever's been configured as
ResourcesModule.downloadPath , with a single leading slash and no leading slash. |
protected String |
fingerPrintFor(info.magnolia.resourceloader.Resource resource) |
info.magnolia.resourceloader.Resource |
getResource(String pathInfo)
Called with a pathInfo, cleans up the given path and returns the corresponding
Resource . |
String |
getServletMapping() |
String |
linkTo(String path,
boolean addFingerPrint) |
protected String |
stripFarFutureCachingTimestamp(String resourcePath) |
@Inject public ResourceLinker(info.magnolia.resourceloader.ResourceOrigin origin, javax.inject.Provider<ResourcesModule> configuration, javax.inject.Provider<info.magnolia.cms.core.AggregationState> aggregationStateProvider, info.magnolia.templating.functions.TemplatingFunctions templatingFunctions)
public String getServletMapping()
protected String cleanDownloadPath()
ResourcesModule.downloadPath
, with a single leading slash and no leading slash.public info.magnolia.resourceloader.Resource getResource(String pathInfo)
Resource
.
Leniently returns null if no such resource exists.HttpServletRequest.getPathInfo()
protected String fingerPrintFor(info.magnolia.resourceloader.Resource resource)
Copyright © 2015 Magnolia International Ltd.. All rights reserved.