Package com.dtolabs.rundeck.core.plugins
Class ZipResourceLoader
- java.lang.Object
-
- com.dtolabs.rundeck.core.plugins.ZipResourceLoader
-
- All Implemented Interfaces:
PluginResourceLoader
public class ZipResourceLoader extends java.lang.Object implements PluginResourceLoader
Created by greg on 8/26/16.
-
-
Constructor Summary
Constructors Constructor Description ZipResourceLoader(java.io.File cacheDir, java.io.File zipFile, java.util.List<java.lang.String> resourcesList, java.lang.String resourcesBasedir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
extractResources()
Extract resources return the extracted filesjava.lang.String[]
getResourceNames()
Get the list of resources in the jarjava.util.List<java.lang.String>
listResources()
java.io.InputStream
openResourceStreamFor(java.lang.String path)
Open a stream to load a resource
-
-
-
Method Detail
-
listResources
public java.util.List<java.lang.String> listResources()
- Specified by:
listResources
in interfacePluginResourceLoader
- Returns:
- the list of resources available
-
getResourceNames
public java.lang.String[] getResourceNames()
Get the list of resources in the jar
-
openResourceStreamFor
public java.io.InputStream openResourceStreamFor(java.lang.String path) throws PluginException, java.io.IOException
Description copied from interface:PluginResourceLoader
Open a stream to load a resource- Specified by:
openResourceStreamFor
in interfacePluginResourceLoader
- Parameters:
path
- resource path and name- Returns:
- input stream for the resources, must be closed when finished, or null if the plugin does not support resources
- Throws:
PluginException
- if a path is requested that was not in the pluginjava.io.IOException
- if an error occurs
-
extractResources
public void extractResources() throws java.io.IOException
Extract resources return the extracted files- Throws:
java.io.IOException
-
-