Class JarClassLoader


  • public class JarClassLoader
    extends ClassLoader
    This ClassLoader is intended to be used to load agent classes packed within a jar file. If the specified jar does not exist this ClassLoader will attempt to load classes from the system ClassLoader.
    Version:
    1.2
    Author:
    Jordi Cucurull Juan, Joan Ametller Esquerra
    • Method Detail

      • close

        public void close()
        Method which close the JAR file.
      • getJarFileName

        public String getJarFileName()
        Get the Jar filename.
        Returns:
        String - Jar absolute path.
      • findResource

        public URL findResource​(String name)
        Get a resource from within this classloader. public InputStream getResourceAsStream(String name) { if (_jarFile != null) { ZipEntry zEntry = _jarFile.getEntry(name); try { if (zEntry != null) { return _jarFile.getInputStream(zEntry); } else return null; } catch (IOException ioe) { return null; } } else { return null; } }
        Overrides:
        findResource in class ClassLoader
      • finalize

        protected void finalize()
                         throws Throwable
        Clean up the JarClassLoader. This means closing the JAR file if it has not explicitly done before by using the provided close() method.
        Overrides:
        finalize in class Object
        Throws:
        Throwable