blob: b858bd0f5a22c4bb274f00e676640728c6e993c6 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2005, 2006 Erkki Lindpere 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Erkki Lindpere - initial API and implementation
*******************************************************************************/
package org.eclipse.ecf.internal.bulletinboard.commons.util;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
public class IDUtil {
public static URI composeURI(URL baseURL, String tail)
throws URISyntaxException {
String url = baseURL.toString();
if (!url.endsWith("/")) {
url = url + "/";
}
if (tail.startsWith("/")) {
tail = tail.substring(1);
}
url = url + tail;
return new URI(url);
}
}