Code example for JarFile

Methods: getInputStream, getJarEntry

0
     
    public ClassFile getClassFileFromInternalName(String internalClassName){
        ClassFile cf = null;
        internalClassName = getClassPath(internalClassName);
        try { 
            JarEntry je = jf.getJarEntry(rootClassDir + internalClassName); // No I18N
            cf = new ClassFile(jf.getInputStream(je));
        } catch (IOException ex){
            logger.warning("Exception while reading class file:" + internalClassName + ":" + ex.getMessage());
        } 
         
        return cf;
    } 
     
    public ClassFile getClassFile(ClassName className){
        ClassFile cf = null;
        try { 
            JarEntry je = jf.getJarEntry(rootClassDir + getClassPath(className)); // No I18N
            cf = new ClassFile(jf.getInputStream(je));
        } catch (IOException ex){
            logger.warning("Exception while reading class file:" + className + ":" + ex.getMessage());