Code example for JarFile

Methods: getInputStream, getJarEntry

0
      String dtdName = resolverMap.getProperty(publicId);
      if (dtdName != null) {
        File systemJar = new File(distributionDirectory + File.separator + "lib" + File.separator
            + "jboss-system.jar"); 
        if (systemJar.exists()) {
          JarFile j = new JarFile(systemJar);
          JarEntry entry = j.getJarEntry("dtd/" + dtdName);
          if (entry == null) {
            entry = j.getJarEntry("org/jboss/metadata/" + dtdName);
          } 
 
          if (entry != null) {
            if (log.isDebugEnabled())
              log.debug("Found DTD locally: " + entry.getName());
 
            return new InputSource(j.getInputStream(entry));
          } 
        } 
      } 
 
      return null;