public class MemoryLocalWebResourceMapper extends Object implements WebResourceMapper
WebResourceMapper which retrieves a mappings from a local JSON file and keeps it in memory.| Constructor and Description |
|---|
MemoryLocalWebResourceMapper(WebResourceIntegration webResourceIntegration,
MappingParser mappingParser,
PrebakeConfig prebakeConfig,
String globalStateHash,
String ctCdnBaseUrl,
String contextPath) |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
map(String resourceUrl)
Maps a local resource URL into a CDN-based URL list (a local resource could be mapped into multiple CDN resources).
|
MappingSet |
mappings()
Inspects mappings used by one instance.
|
Optional<String> |
mapSingle(String resourceUrl)
Maps a local resource URL into a CDN-based URL.
|
public MemoryLocalWebResourceMapper(@Nonnull WebResourceIntegration webResourceIntegration, @Nonnull MappingParser mappingParser, @Nonnull PrebakeConfig prebakeConfig, @Nonnull String globalStateHash, @Nonnull String ctCdnBaseUrl, @Nonnull String contextPath) throws MappingParserException, IOException
mappingParser - A parser to parse mappings from JSON.prebakeConfig - PreBake configuration produced by the product which will point to the mappings file.globalStateHash - Hash which identify current product and enabled plugins as in Config.computeGlobalStateHash()ctCdnBaseUrl - Cross-tenant CDN base URL. Will prefix all resource's mapped URLs.MappingParserExceptionIOException@Nonnull public List<String> map(@Nonnull String resourceUrl)
WebResourceMapperMaps a local resource URL into a CDN-based URL list (a local resource could be mapped into multiple CDN resources).
For instance, it would transform a URL like/jira/my/resource/hash/batch.js into one or more
domain-relative URLs like //my.cdn.com/my/resource/hash/batch.js.map in interface WebResourceMapperresourceUrl - URL of wanted web resource (includes context).@Nonnull public Optional<String> mapSingle(@Nonnull String resourceUrl)
WebResourceMapperMaps a local resource URL into a CDN-based URL.
For instance, it would transform a URL like/jira/my/resource/hash/batch.js into a
domain-relative URL like //my.cdn.com/my/resource/hash/batch.js.mapSingle in interface WebResourceMapperresourceUrl - URL of wanted web resource (includes context).@Nonnull public MappingSet mappings()
WebResourceMappermappings in interface WebResourceMapperCopyright © 2017 Atlassian. All rights reserved.