setURL(url, url.getProtocol(), bundleId, resIndex, SECURITY_AUTHORIZED, null, path, null, null);
setURL(url, url.getProtocol(), bundleId, resIndex, SECURITY_AUTHORIZED, null, path, null, url.getRef());
	protected void parseURL(URL url, String str, int start, int end) {		if (end < start)			return;		if (url.getPath() != null)			// A call to a URL constructor has been made that uses an authorized URL as its context.			// Null out bundleEntry because it will not be valid for the new path			bundleEntry = null;		String spec = ""; //$NON-NLS-1$		if (start < end)			spec = str.substring(start, end);		end -= start;		//Default is to use path and bundleId from context		String path = url.getPath();		String bundleId = url.getHost();		int resIndex = 0; // must start at 0 index if using a context		int pathIdx = 0;		if (spec.startsWith("//")) { //$NON-NLS-1$			int bundleIdIdx = 2;			pathIdx = spec.indexOf('/', bundleIdIdx);			if (pathIdx == -1) {				pathIdx = end;				// Use default				path = ""; //$NON-NLS-1$			}			int bundleIdEnd = spec.indexOf(':', bundleIdIdx);			if (bundleIdEnd > pathIdx || bundleIdEnd == -1)				bundleIdEnd = pathIdx;			if (bundleIdEnd < pathIdx - 1)				try {					resIndex = Integer.parseInt(spec.substring(bundleIdEnd + 1, pathIdx));				} catch (NumberFormatException e) {					// do nothing; results in resIndex == 0				}			bundleId = spec.substring(bundleIdIdx, bundleIdEnd);		}		if (pathIdx < end && spec.charAt(pathIdx) == '/')			path = spec.substring(pathIdx, end);		else if (end > pathIdx) {			if (path == null || path.equals("")) //$NON-NLS-1$				path = "/"; //$NON-NLS-1$			int last = path.lastIndexOf('/') + 1;			if (last == 0)				path = spec.substring(pathIdx, end);			else				path = path.substring(0, last) + spec.substring(pathIdx, end);		}		if (path == null)			path = ""; //$NON-NLS-1$		//modify path if there's any relative references		int dotIndex;		while ((dotIndex = path.indexOf("/./")) >= 0) //$NON-NLS-1$			path = path.substring(0, dotIndex + 1) + path.substring(dotIndex + 3);		if (path.endsWith("/.")) //$NON-NLS-1$			path = path.substring(0, path.length() - 1);		while ((dotIndex = path.indexOf("/../")) >= 0) { //$NON-NLS-1$			if (dotIndex != 0)				path = path.substring(0, path.lastIndexOf('/', dotIndex - 1)) + path.substring(dotIndex + 3);			else				path = path.substring(dotIndex + 3);		}		if (path.endsWith("/..") && path.length() > 3) //$NON-NLS-1$			path = path.substring(0, path.length() - 2);		while ((dotIndex = path.indexOf("//")) >= 0) //$NON-NLS-1$			path = path.substring(0, dotIndex + 1) + path.substring(dotIndex + 2);		// Check the permission of the caller to see if they		// are allowed access to the resource.		checkAdminPermission(context.getBundle(Long.parseLong(bundleId)));		// Setting the authority portion of the URL to SECURITY_ATHORIZED		// ensures that this URL was created by using this parseURL		// method.  The openConnection method will only open URLs		// that have the authority set to this.		setURL(url, url.getProtocol(), bundleId, resIndex, SECURITY_AUTHORIZED, null, path, null, null);	}