Class PluginResource
java.lang.Object
org.pentaho.platform.web.http.api.resources.PluginResource
Represents the public files available in a plugin.
- Author:
- aaron
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected jakarta.servlet.http.HttpServletResponseprotected org.pentaho.platform.api.engine.IPluginManagerprotected org.pentaho.platform.api.engine.IPluginManagerprotected File -
Constructor Summary
ConstructorsConstructorDescriptionPluginResource(jakarta.servlet.http.HttpServletResponse httpServletResponse) -
Method Summary
Modifier and TypeMethodDescriptionprotected InputStreamgetCacheBackedStream(String pluginId, String path, boolean useCache) jakarta.ws.rs.core.ResponseRetrieve the file from the selected plugin.jakarta.ws.rs.core.ResponseRetrieve the file from the selected plugin, optionally not affecting the current HTTP response headers.
-
Field Details
-
systemFolder
-
pluginManager
protected org.pentaho.platform.api.engine.IPluginManager pluginManager -
pluginMgr
protected org.pentaho.platform.api.engine.IPluginManager pluginMgr -
httpServletResponse
@Context protected jakarta.servlet.http.HttpServletResponse httpServletResponse
-
-
Constructor Details
-
PluginResource
public PluginResource() -
PluginResource
public PluginResource(jakarta.servlet.http.HttpServletResponse httpServletResponse)
-
-
Method Details
-
getCacheBackedStream
protected InputStream getCacheBackedStream(String pluginId, String path, boolean useCache) throws IOException - Throws:
IOException
-
readFile
@GET @Path("/files/{path : .+}") @Produces("*/*") public jakarta.ws.rs.core.Response readFile(@PathParam("pluginId") String pluginId, @PathParam("path") String path) throws IOException Retrieve the file from the selected plugin. This file is a static file (i.e javascript, html, css etc)- Parameters:
pluginId- (Plugin ID of the selected Plugin)path- (Path of the file being retrieved. This is a colon separated path to the plugin file. This is usually a static file like a javascript, image or html- Returns:
- Throws:
IOException
-
readFile
public jakarta.ws.rs.core.Response readFile(String pluginId, String path, boolean changeResponseHeaders) throws IOException Retrieve the file from the selected plugin, optionally not affecting the current HTTP response headers.- Parameters:
pluginId- The plugin id.path- The file path.changeResponseHeaders- Whether to change the HTTP response headers to reflect aspects such as cache control.- Returns:
- The response containing the file content.
- Throws:
IOException
-