Class JarResourceLoader

    • Field Summary

      Fields 
      Modifier and Type Field Description
      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 boolean initializeCalled  
      private java.util.Map<java.lang.String,​JarHolder> jarfiles
      Maps JAR URLs to the actual JAR (key = the JAR URL, value = the JAR).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void addEntries​(java.util.Map entries)
      Copy all the entries into the entryDirectory.
      void addSearchPath​(java.lang.String path)  
      private void closeJar​(java.lang.String path)
      Closes a Jar file and set its URLConnection to null.
      PlexusResource getResource​(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.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

      • 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<java.lang.String,​JarHolder> jarfiles
        Maps JAR URLs to the actual JAR (key = the JAR URL, value = the JAR).
      • initializeCalled

        private boolean initializeCalled
    • 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.Map entries)
        Copy all the entries into the entryDirectory. It will overwrite any duplicate keys.
      • getResource

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