org.codehaus.plexus.resource.loader
Class JarResourceLoader

java.lang.Object
  extended by org.codehaus.plexus.logging.AbstractLogEnabled
      extended by org.codehaus.plexus.resource.loader.AbstractResourceLoader
          extended by org.codehaus.plexus.resource.loader.JarResourceLoader
All Implemented Interfaces:
org.codehaus.plexus.logging.LogEnabled, ResourceLoader

public class JarResourceLoader
extends AbstractResourceLoader

Author:
Jason van Zyl

Field Summary
private  java.util.Map entryDirectory
          Maps entries to the parent JAR File Key = the entry *excluding* plain directories Value = the JAR URL
static java.lang.String ID
           
private  java.util.Map jarfiles
          Maps JAR URLs to the actual JAR Key = the JAR URL Value = the JAR
 
Fields inherited from class org.codehaus.plexus.resource.loader.AbstractResourceLoader
paths
 
Fields inherited from interface org.codehaus.plexus.resource.loader.ResourceLoader
ROLE
 
Constructor Summary
JarResourceLoader()
           
 
Method Summary
private  void addEntries(java.util.Hashtable entries)
          Copy all the entries into the entryDirectory It will overwrite any duplicate keys.
private  void closeJar(java.lang.String path)
          Closes a Jar file and set its URLConnection to null.
 java.io.InputStream getResourceAsInputStream(java.lang.String source)
          Get an InputStream so that the Runtime can build a template with it.
 void initialize()
           
private  void loadJar(java.lang.String path)
           
 
Methods inherited from class org.codehaus.plexus.resource.loader.AbstractResourceLoader
addSearchPath
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final java.lang.String ID
See Also:
Constant Field Values

entryDirectory

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


jarfiles

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

Constructor Detail

JarResourceLoader

public JarResourceLoader()
Method Detail

initialize

public void initialize()
                throws org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
Throws:
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException

loadJar

private void loadJar(java.lang.String path)

closeJar

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


addEntries

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


getResourceAsInputStream

public java.io.InputStream getResourceAsInputStream(java.lang.String source)
                                             throws ResourceNotFoundException
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.