Code example for URI

Methods: isAbsolute, relativize

0
    public URI getBaseResourceURI() {
        return _absoluteDir.toURI();
    } 
 
    private URI relativize(URI u) {
        if (u.isAbsolute()) {
            return _absoluteDir.toURI().relativize(u);
        } else return u;
    } 
 
    public URI resolve(URI parent, URI child) {
        parent = relativize(parent);
        child = relativize(child);
        URI result = parent.resolve(child);
        URI result2 = _absoluteDir.toURI().resolve(result);
        if (__log.isDebugEnabled()) {
            __log.debug("resolving URI: parent " + parent + " child " + child + " result " + result + " resultAbsolute:" + result2);
        } 
 
        return result2;
    }