org.codehaus.plexus.resource.loader

Class JarResourceLoader

public class JarResourceLoader extends AbstractResourceLoader

Author: Jason van Zyl

UNKNOWN: role-hint="jar"

Field Summary
MapentryDirectory
Maps entries to the parent JAR File Key = the entry *excluding* plain directories Value = the JAR URL
static StringID
Mapjarfiles
Maps JAR URLs to the actual JAR Key = the JAR URL Value = the JAR
Method Summary
voidaddEntries(Hashtable entries)
Copy all the entries into the entryDirectory It will overwrite any duplicate keys.
voidcloseJar(String path)
Closes a Jar file and set its URLConnection to null.
InputStreamgetResourceAsInputStream(String source)
Get an InputStream so that the Runtime can build a template with it.
voidinitialize()
voidloadJar(String path)

Field Detail

entryDirectory

private Map entryDirectory
Maps entries to the parent JAR File Key = the entry *excluding* plain directories Value = the JAR URL

ID

public static final String ID

jarfiles

private Map jarfiles
Maps JAR URLs to the actual JAR Key = the JAR URL Value = the JAR

Method Detail

addEntries

private void addEntries(Hashtable entries)
Copy all the entries into the entryDirectory It will overwrite any duplicate keys.

closeJar

private void closeJar(String path)
Closes a Jar file and set its URLConnection to null.

getResourceAsInputStream

public InputStream getResourceAsInputStream(String source)
Get an InputStream so that the Runtime can build a template with it.

Parameters: source name of template to get

Returns: InputStream containing the template

Throws: ResourceNotFoundException if template not found in the file template path.

initialize

public void initialize()

loadJar

private void loadJar(String path)