URLStreamHandler handler = bpkgs.bundle.framework.bundleURLStreamhandler; URL url = new URL(BundleURLStreamHandler.PROTOCOL, Long.toString(bpkgs.bundle.id), jarId, name.startsWith("/") ? name : ("/" + name), handler);
URL url = null; if(Framework.REGISTERBUNDLEURLHANDLER) { url = new URL(BundleURLStreamHandler.PROTOCOL, Long.toString(bpkgs.bundle.id), jarId, name.startsWith("/") ? name : ("/" + name)); } else { URLStreamHandler handler = bpkgs.bundle.framework.bundleURLStreamhandler; url = new URL(BundleURLStreamHandler.PROTOCOL, Long.toString(bpkgs.bundle.id), jarId, name.startsWith("/") ? name : ("/" + name), handler); }
  private Enumeration findBundleResources(String name) {    Vector answer = new Vector(1);    Vector items = archive.componentExists(name);    if (items != null) {      for(int i = 0; i < items.size(); i++) {        int jarId = items.size() == 1           ? -1          : ((Integer)items.elementAt(i)).intValue();                try {          URLStreamHandler handler             = bpkgs.bundle.framework.bundleURLStreamhandler;          URL url = new URL(BundleURLStreamHandler.PROTOCOL,                             Long.toString(bpkgs.bundle.id),                            jarId,                            name.startsWith("/") ? name : ("/" + name),                            handler);          if (debug) {            Debug.println("classLoader(#" + bpkgs.bundle.id + ") - found: " + name + " -> " + url);          }          answer.addElement(url);        } catch (MalformedURLException ignore) {          ignore.printStackTrace();          // Return null since we couldn't construct a valid url.          // TODO: Rewrite URL if we have special characters.        }      }    }    return answer.elements();  }