private static Loader getLoader(final URL url, int index) throws IOException {
      String s;
      final String protocol = url.getProtocol();
      try {
        s = Loader.JRT_PROTOCOL.equals(protocol)? url.getFile() : url.toURI().getSchemeSpecificPart();
      }
      catch (URISyntaxException thisShouldNotHappen) {
        thisShouldNotHappen.printStackTrace();
        s = url.getFile();
      }

      if (s != null && s.length() > 0) {
        if (Loader.JRT_PROTOCOL.equals(protocol)) {
          final Loader jrtLoader = JrtClassHolder.create(url, index);
          if (jrtLoader != null) {
            return jrtLoader;
          }
        }
        if (new File(s).isDirectory()) {
          return Loader.FILE_PROTOCOL.equals(protocol) ? new FileLoader(url, index) : null;
        }
      }

      // by default treat the url as a jar archive
      return new JarLoader(url, index);
    }
private static Loader getLoader(final URL url, int index)