public class CDNLinkInterceptor extends Object implements LinkInterceptor
| Modifier and Type | Field and Description |
|---|---|
protected String |
cdnHost |
protected boolean |
isDevMode |
| Constructor and Description |
|---|
CDNLinkInterceptor(String cdnHost,
Map<String,String> cdnMap,
boolean isDevMode) |
CDNLinkInterceptor(String cdnHost,
ResourceBundle cdnBundle,
boolean isDevMode) |
| Modifier and Type | Method and Description |
|---|---|
protected static Map<String,String> |
bundleAsMap(ResourceBundle bundle,
boolean isDevMode)
Converts ResourceBundle to a Map
|
String |
transformURL(String url) |
protected final boolean isDevMode
protected final String cdnHost
public CDNLinkInterceptor(String cdnHost, ResourceBundle cdnBundle, boolean isDevMode) throws URISyntaxException
cdnHost - the CDN server hostname (e.g., "cdn.example.com")cdnMap - a mapping of paths to their compacted form (e.g., "/foo.js" => "/foo.min.js")isDevMode - uses normal paths unless compacted form has a dev form (e.g., "/foo.js" => "/foo.min.js" => "/foo.test.js", else "/foo.js")URISyntaxExceptionpublic CDNLinkInterceptor(String cdnHost, Map<String,String> cdnMap, boolean isDevMode) throws URISyntaxException
cdnHost - the CDN server hostname (e.g., "cdn.example.com")cdnMap - a mapping of paths to their compacted form (e.g., "/foo.js" => "/foo.min.js")isDevMode - uses normal paths unless compacted form has a dev form (e.g., "/foo.js" => "/foo.min.js" => "/foo.test.js", else "/foo.js")URISyntaxExceptionpublic String transformURL(String url)
transformURL in interface LinkInterceptorprotected static Map<String,String> bundleAsMap(ResourceBundle bundle, boolean isDevMode)
cdnBundle - Copyright © 2014. All rights reserved.