code: private URL findJarForResource(URL url) {
          // 如果URL的文件部分本身是一个URL，那么该URL可能指向JAR
          try {
              long startTime = System.currentTimeMillis();
              while (true) {
                  url = new URL(url.getFile());
                  if (System.currentTimeMillis() - startTime > MAX_LIMIT) {
                      break;
                  }
              }
          } catch (MalformedURLException expected) {
              // This will happen at some point and serves as a break in the loop
          }
  
          // Look for the .jar extension and chop off everything after that
          StringBuilder jarUrl = new StringBuilder(url.toExternalForm());
          int index = jarUrl.lastIndexOf(".jar");
          if (index >= 0) {
              jarUrl.setLength(index + 4);
          } else {
              return null;
          }
  
          // Try to open and test it
          try {
              URL testUrl = new URL(jarUrl.toString());
              if (this.isJar(testUrl)) {
                  return testUrl;
              }
  
              // WebLogic fix: check if the URL's file exists in the filesystem.
              jarUrl.replace(0, jarUrl.length(), testUrl.getFile());
              File file = new File(jarUrl.toString());
  
              // File name might be URL-encoded
              if (!file.exists()) {
                  file = new File(URLEncoder.encode(jarUrl.toString(), "UTF-8"));
              }
  
              if (file.exists()) {
                  testUrl = file.toURI().toURL();
                  if (isJar(testUrl)) {
                      return testUrl;
                  }
              }
          } catch (MalformedURLException e) {
              log.warn("Invalid JAR URL: " + jarUrl);
          } catch (UnsupportedEncodingException e) {
              throw new ZealotException("Unsupported encoding?  UTF-8?  That's unpossible.");
          }
  
          return null;
      }
docs: 从jar包中找到URL资源.
  @param url url
  @return url