Java URI to convertToAbsPath(URI baseURI, String path)

Here you can find the source of convertToAbsPath(URI baseURI, String path)

Description

convert To Abs Path

License

Apache License

Declaration

public static String convertToAbsPath(URI baseURI, String path) throws Exception 

Method Source Code


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

import java.io.File;
import java.net.URI;

public class Main {
    public static String convertToAbsPath(URI baseURI, String path) throws Exception {

        // if path is either null or empty, we return it
        // because nothing to convert
        if (path == null || path.isEmpty()) {
            return path;
        }/* w w  w .  ja v a2 s  . c o  m*/

        File absFile = new File(baseURI.resolve(path));

        return absFile.getCanonicalPath();

    }
}

Related

  1. convertToEncodedURIString(String input)
  2. extractBaseUriFromRDF(String rdfString)
  3. extractContentDigest(URI contentDigest)
  4. extractForwardURIFrom(URI requestURI)