public ConnectorRARClassLoader(String jarName, ClassLoader parent) { super(parent); // Create the JarResource and suck in the .jar file. jarResources = new JarResourceExtractor(jarName); }
public String getResourceAsString(String raDeploymentDescPath) { return new String(jarResources.getResource(raDeploymentDescPath)); }
/** * creates a JarResourceExtractor. It extracts all resources from a Jar into an * internal hashtable, keyed by resource names. * * @param jarFileName * a jar or zip file */ public JarResourceExtractor(String jarFileName) { init(jarFileName); }
byte[] b = getZipEntryContents(ze,zis); extractResources(new ZipInputStream(bis)); } else {
/** initializes internal hash tables with Jar file resources. */ private void init(String jarFileName) { try { //extract resources and put them into the hashtable. FileInputStream fis = new FileInputStream(jarFileName); BufferedInputStream bis = new BufferedInputStream(fis); ZipInputStream zis = new ZipInputStream(bis); extractResources(zis); } catch (Exception ex){ ex.printStackTrace(); } }
/** * @throws FileNotFoundException * @throws IOException */ private void extractResources(ZipInputStream zis) throws FileNotFoundException, IOException { ZipEntry ze = null; while ((ze = zis.getNextEntry()) != null) { if(_logger.isLoggable(Level.FINER)) { _logger.finer("ExtractResources : " + ze.getName()); } extractZipEntryContents(ze, zis); } }
protected byte[] loadClassBytes(String className) { className = formatClassName(className); return (jarResources.getResource(className)); }