Here you can find the source of getCanonicalPath(String path)
public static String getCanonicalPath(String path)
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static String getCanonicalPath(String path) { String result = null;//from ww w.j a v a2 s . com try { result = new File(path).getCanonicalPath(); } catch (IOException e) { throw new RuntimeException("get Canonical path exception", e); } return result; } }