public static java.lang.String | resolve(java.lang.String context, java.lang.String spec)
try {
if (context != null) {
return (new PURL(new PURL(context), spec)).toString();
} else {
// We are dealing with a URL and we do not have a base
// URI. Check if there is any protocol specified. If there is,
// then we use the URL class to make the URL absolute. Otherwise,
// we simply return the relative URL.
if (spec.indexOf(':") != -1) {
return (new PURL(spec)).toString();
} else {
return spec;
}
}
} catch (Error e) {
e.printStackTrace();
throw new IllegalArgumentException();
}
|