public URI rebaseLink()

in doxia-site-model/src/main/java/org/apache/maven/doxia/site/inheritance/URIPathDescriptor.java [148:172]


    public URI rebaseLink(final String newBase) {
        if (link.isAbsolute()) {
            return link;
        }

        if (newBase == null) {
            return resolveLink();
        }

        final URI newBaseURI;

        try {
            newBaseURI = new URI(newBase);
        } catch (URISyntaxException ex) {
            return resolveLink();
        }

        if (!sameSite(newBaseURI)) {
            return resolveLink();
        }

        final String relativeBasePath = PathTool.getRelativeWebPath(newBaseURI.getPath(), baseURI.getPath());

        return URI.create(correctRelativePath(relativeBasePath)).resolve(link);
    }