private static void _searchFromURL ( Set < URL > result , String prefix , String suffix , URL url ) throws IOException { boolean done = false ; InputStream is = _getInputStream ( url ) ; if ( is != null ) { try { ZipInputStream zis ; if ( is instanceof ZipInputStream ) { zis = ( ZipInputStream ) is ; } else { zis = new ZipInputStream ( is ) ; } try { ZipEntry entry = zis . getNextEntry ( ) ; // initial entry should not be null // if we assume this is some inner jar done = entry != null ; while ( entry != null ) { String entryName = entry . getName ( ) ; if ( entryName . endsWith ( suffix ) ) { result . add ( new URL ( url . toExternalForm ( ) + entryName ) ) ; } entry = zis . getNextEntry ( ) ; } } finally { zis . close ( ) ; } } catch ( Exception ignore ) { } } if ( ! done && prefix . length ( ) > 0 ) { // we add '/' at the end since join adds it as well String urlString = url . toExternalForm ( ) + "/" ; String [ ] split = prefix . split ( "/" ) ; prefix = _join ( split , true ) ; String end = _join ( split , false ) ; urlString = urlString . substring ( 0 , urlString . lastIndexOf ( end ) ) ; if ( isExcludedPrefix ( urlString ) ) { // excluded URL found, ignore it return ; } url = new URL ( urlString ) ; _searchFromURL ( result , prefix , suffix , url ) ; } }
Search from URL . Fall back on prefix tokens if not able to read from original url param .