Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2003, 2006 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at Contributors: IBM Corporation - initial API and implementation /
package org.eclipse.osgi.framework.internal.protocol.reference;

URLStreamHandler for reference protocol. A reference URL is used to hold a reference to a local file URL. A reference URL allows bundles to be installed by reference. This means the content of the bundle will not be copied. Instead the content of the bundle will be loaded from the reference location specified by the reference URL. The Framework only supports reference URLs that refer to a local file URL. For example:

public class Handler extends URLStreamHandler {
	public Handler() {
	protected URLConnection openConnection(URL urlthrows IOException {
		return new ReferenceURLConnection(url);
	protected void parseURL(URL urlString strint startint end) {
		if (end < start) {
		String reference = (start < end) ? str.substring(startend) : url.getPath();
		setURL(urlurl.getProtocol(), null, -1, nullnullreferencenullnull);
New to GrepCode? Check out our FAQ X