code: protected static boolean isDir(URL url)
      {
          String file = url.getFile();
          return file != null && file.endsWith("/");
      }
docs: Test whether given URL points to a directory. URL is deemed to point to a directory if has non-null "file"
  component ending with "/".
  
  @param url the URL to test
  @return true if the URL points to a directory, false otherwise