public class AssetsController extends Object
Constructor and Description |
---|
AssetsController() |
Modifier and Type | Method and Description |
---|---|
String |
bundle(String fileName)
Output the HTML required to render a bundle of assets.
|
String |
bundle(String plugin,
String path) |
static String |
ensureSafeAssetsPath(String path) |
Long |
getCurrentTimeStampForAssetFile(String path) |
static HashMap<String,Long> |
getTimeStampByPath() |
Long |
getTimeStampForAssetFile(String path) |
AssetsControllerSafeWrapper |
getWrapper() |
static AssetsController |
instance() |
static AssetsController |
load() |
String |
pageFooterLiterals()
Turn a list of additional strings that should be in the Footer section of the
page and return as a string
|
String |
pageHeadLiterals()
Turn a list of additional strings that should be in the HEAD section of the
page and return as a string
|
String |
resource(String path)
Loads a resource from the main stallion jar.
|
String |
resource(String path,
String plugin) |
String |
resource(String path,
String plugin,
String developerUrl)
Get the URL to access an asset file that is bundled in the jar as a resource.
|
static void |
setTimeStampByPath(HashMap<String,Long> timeStampByPath) |
static void |
shutdown() |
String |
url(String path)
Get the URL for an asset file, with a timestamp added for cache busting.
|
static AssetsControllerSafeWrapper |
wrapper()
Get a wrapper for the asset controller with limited methods.
|
public AssetsController()
public static AssetsController instance()
public static String ensureSafeAssetsPath(String path)
public static AssetsControllerSafeWrapper wrapper()
public static AssetsController load()
public static void shutdown()
public static HashMap<String,Long> getTimeStampByPath()
public static void setTimeStampByPath(HashMap<String,Long> timeStampByPath)
public String resource(String path)
path
- public String resource(String path, String plugin, String developerUrl)
path
- - the path, relative to the assets folder in side the resource directoryplugin
- - the plugin from which you are loading the resource, use "stallion" to load from the main jardeveloperUrl
- - an alternative URL to use in development mode. Useful if you want to point
you local nginx directly at the file, so you can see your changes without recompiling.public String pageFooterLiterals()
public String pageHeadLiterals()
public String bundle(String fileName)
fileName
- public String url(String path)
path
- public Long getTimeStampForAssetFile(String path)
public Long getCurrentTimeStampForAssetFile(String path)
public AssetsControllerSafeWrapper getWrapper()
Copyright © 2016. All rights reserved.