private void includeJar ( File file ) { if ( file . isDirectory ( ) ) { return ; } URL jarURL = null ; JarFile jar = null ; try { jarURL = new URL ( "jar:" + new URL ( "file:/" + file . getCanonicalPath ( ) ) . toExternalForm ( ) + "!/" ) ; JarURLConnection conn = ( JarURLConnection ) jarURL . openConnection ( ) ; jar = conn . getJarFile ( ) ; } catch ( MalformedURLException ignore ) { return ; } catch ( IOException ignore ) { return ; } if ( jar == null ) { return ; } try { this . locationMap . put ( jarURL . toURI ( ) , "" ) ; } catch ( URISyntaxException ignore ) { } for ( Enumeration < JarEntry > e = jar . entries ( ) ; e . hasMoreElements ( ) ; ) { JarEntry entry = e . nextElement ( ) ; if ( this . pkgFilter != null && entry . getName ( ) . startsWith ( this . pkgFilter ) ) { continue ; } if ( entry . isDirectory ( ) ) { if ( entry . getName ( ) . toUpperCase ( Locale . ENGLISH ) . equals ( "META-INF/" ) ) { continue ; } try { this . locationMap . put ( new URI ( jarURL . toExternalForm ( ) + entry . getName ( ) ) , CF_Utils . getPkgName ( entry ) ) ; } catch ( URISyntaxException ignore ) { continue ; } } } }
Include from a jar file