Here you can find the source of getCanonicalPath(String basePath, String path)
Parameter | Description |
---|---|
basePath | a parameter |
path | a parameter |
Parameter | Description |
---|---|
IOException | an exception |
public static String getCanonicalPath(String basePath, String path) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.IOException; public class Main { /**//from www .j a v a 2s .c om * Get the canonical path from the basePath and relative path. * * @param basePath * @param path * @return the canonical path from the "path". * @throws IOException */ public static String getCanonicalPath(String basePath, String path) throws IOException { File found = null; if (!(new File(path).isAbsolute())) { found = new File(basePath, path); } else { found = new File(path); } return found.getCanonicalPath(); } }