Here you can find the source of getCanonicalPath(final String path)
public static String getCanonicalPath(final String path)
//package com.java2s; //License from project: LGPL import java.io.File; public class Main { public static String getCanonicalPath(final String path) { try {/* ww w .j av a2 s . com*/ return (new File(path)).getCanonicalPath(); } catch (Throwable ignored) { return path; } } }