public class AbstractAppPluginRootResource<T extends AppPlugin> extends Object
Subclasses of this class may provide subresources using annotated getters in order to be multi-engine aware.
Subresources must properly initialize the subresources via
subResource(AbstractAppPluginResource, String)
.
Modifier and Type | Field and Description |
---|---|
static String |
MIME_TYPE_TEXT_CSS |
static String |
MIME_TYPE_TEXT_HTML |
static String |
MIME_TYPE_TEXT_JAVASCRIPT |
static String |
MIME_TYPE_TEXT_PLAIN |
protected AppRuntimeDelegate<T> |
runtimeDelegate |
Constructor and Description |
---|
AbstractAppPluginRootResource(String pluginName,
AppRuntimeDelegate<T> runtimeDelegate) |
Modifier and Type | Method and Description |
---|---|
protected InputStream |
applyResourceOverrides(String file,
InputStream assetStream) |
javax.ws.rs.core.Response |
getAsset(String file)
Provides a plugins asset files via
$PLUGIN_ROOT_PATH/static . |
protected InputStream |
getClasspathResourceAsStream(AppPlugin plugin,
String assetDirectory,
String fileName) |
protected String |
getContentType(String file) |
protected InputStream |
getPluginAssetAsStream(AppPlugin plugin,
String fileName)
Returns an input stream for a given resource
|
protected InputStream |
getWebResourceAsStream(String assetDirectory,
String fileName) |
protected <S extends AbstractAppPluginResource<T>> |
subResource(S subResource,
String engineName) |
public static final String MIME_TYPE_TEXT_PLAIN
public static final String MIME_TYPE_TEXT_HTML
public static final String MIME_TYPE_TEXT_CSS
public static final String MIME_TYPE_TEXT_JAVASCRIPT
protected AppRuntimeDelegate<T extends AppPlugin> runtimeDelegate
public AbstractAppPluginRootResource(String pluginName, AppRuntimeDelegate<T> runtimeDelegate)
protected <S extends AbstractAppPluginResource<T>> S subResource(S subResource, String engineName)
T
- subResource
- engineName
- @GET @Path(value="/static/{file:.*}") public javax.ws.rs.core.Response getAsset(@PathParam(value="file") String file)
$PLUGIN_ROOT_PATH/static
.file
- protected InputStream applyResourceOverrides(String file, InputStream assetStream)
file
- assetStream
- protected InputStream getPluginAssetAsStream(AppPlugin plugin, String fileName)
resourceName
- protected InputStream getWebResourceAsStream(String assetDirectory, String fileName)
protected InputStream getClasspathResourceAsStream(AppPlugin plugin, String assetDirectory, String fileName)
Copyright © 2021. All rights reserved.