Class JarResourceLoader

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

@Component(role=ResourceLoader.class, hint="jar", instantiationStrategy="per-lookup") public class JarResourceLoader extends AbstractResourceLoader
  • Field Details

    • ID

      public static final String ID
      See Also:
    • entryDirectory

      private Map entryDirectory
      Maps entries to the parent JAR File (key = the entry *excluding* plain directories, value = the JAR URL).
    • jarfiles

      private Map<String,JarHolder> jarfiles
      Maps JAR URLs to the actual JAR (key = the JAR URL, value = the JAR).
    • initializeCalled

      private boolean initializeCalled
  • Constructor Details

    • JarResourceLoader

      public JarResourceLoader()
  • Method Details

    • 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(String path)
    • closeJar

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

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

      public PlexusResource getResource(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.
    • addSearchPath

      public void addSearchPath(String path)
      Specified by:
      addSearchPath in interface ResourceLoader
      Overrides:
      addSearchPath in class AbstractResourceLoader