org.duelengine.duel
Class CDNLinkInterceptor
java.lang.Object
org.duelengine.duel.CDNLinkInterceptor
- All Implemented Interfaces:
- LinkInterceptor
public class CDNLinkInterceptor
- extends Object
- implements LinkInterceptor
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
isDevMode
protected final boolean isDevMode
cdnHost
protected final String cdnHost
CDNLinkInterceptor
public CDNLinkInterceptor(String cdnHost,
ResourceBundle cdnBundle,
boolean isDevMode)
throws URISyntaxException
- Parameters:
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")
- Throws:
URISyntaxException
CDNLinkInterceptor
public CDNLinkInterceptor(String cdnHost,
Map<String,String> cdnMap,
boolean isDevMode)
throws URISyntaxException
- Parameters:
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")
- Throws:
URISyntaxException
transformURL
public String transformURL(String url)
- Specified by:
transformURL in interface LinkInterceptor
bundleAsMap
protected static Map<String,String> bundleAsMap(ResourceBundle bundle,
boolean isDevMode)
- Converts ResourceBundle to a Map
- Parameters:
cdnBundle -
- Returns:
Copyright © 2012. All Rights Reserved.