Java URI to Relative URI resolveRelativeURI(URI base, String rel)

Here you can find the source of resolveRelativeURI(URI base, String rel)

Description

resolve Relative URI

License

Apache License

Declaration

private static String resolveRelativeURI(URI base, String rel) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.net.URI;

public class Main {
    private static String resolveRelativeURI(URI base, String rel) {
        if (base.getFragment() != null) {
            return base + rel;
        }/* w w  w  . j  av a 2s .c  om*/
        return base.resolve(rel).toString();
    }
}

Related

  1. resolvePartUri(URI sourcePartUri, URI targetUri)
  2. resolvePath(URI root, String subPath)
  3. resolvePort(URI uri)
  4. resolveReferenceStartingWithQueryString(final URI baseURI, final URI reference)
  5. resolveRelativeURI(String baseURI, String uriRef)
  6. resolveURI(File base_dir, URI uri)
  7. resolveURI(final String path)
  8. resolveURI(String uri)
  9. resolveUri(URI base, String rel)