private static void searchFromURL(Set result,String prefix,String suffix,URL url) throws IOException {
  boolean done=false;
  InputStream is=getInputStream(url);
  if (is != null) {
    try (ZipInputStream zis=(is instanceof ZipInputStream) ? (ZipInputStream)is : new ZipInputStream(is)){
      ZipEntry entry=zis.getNextEntry();
      done=(entry != null);
      while (entry != null) {
        String entryName=entry.getName();
        if (entryName.endsWith(suffix)) {
          String urlString=url.toExternalForm();
          result.add(new URL(urlString + entryName));
        }
        entry=zis.getNextEntry();
      }
    }
   }
  if (!done && prefix.length() > 0) {
    String urlString=url.toExternalForm() + "/";
    String[] split=prefix.split("/");
    prefix=join(split,true);
    String end=join(split,false);
    int p=urlString.lastIndexOf(end);
    urlString=urlString.substring(0,p);
    for (    String cur : PREFIXES_TO_EXCLUDE) {
      if (urlString.startsWith(cur)) {
        return;
      }
    }
    url=new URL(urlString);
    searchFromURL(result,prefix,suffix,url);
  }
}

private static void searchFromURL ( Set result , String prefix , String suffix , URL url ) throws IOException { boolean done = false ; InputStream is = getInputStream ( url ) ; if ( is != null ) { try ( ZipInputStream zis = ( is instanceof ZipInputStream ) ? ( ZipInputStream ) is : new ZipInputStream ( is ) ) { ZipEntry entry = zis . getNextEntry ( ) ; done = ( entry != null ) ; while ( entry != null ) { String entryName = entry . getName ( ) ; if ( entryName . endsWith ( suffix ) ) { String urlString = url . toExternalForm ( ) ; result . add ( new URL ( urlString + entryName ) ) ; } entry = zis . getNextEntry ( ) ; } } } if ( ! done && prefix . length ( ) > 0 ) { String urlString = url . toExternalForm ( ) + "/" ; String [ ] split = prefix . split ( "/" ) ; prefix = join ( split , true ) ; String end = join ( split , false ) ; int p = urlString . lastIndexOf ( end ) ; urlString = urlString . substring ( 0 , p ) ; for ( String cur : PREFIXES_TO_EXCLUDE ) { if ( urlString . startsWith ( cur ) ) { 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 .
