Here you can find the source of getCanonicalFileName(String filename)
public static String getCanonicalFileName(String filename)
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.IOException; public class Main { public static String getCanonicalFileName(String filename) { String canonicalFileName = filename; try {//from ww w.jav a 2 s. c om canonicalFileName = new File(filename).getCanonicalPath(); } catch (IOException ignore) { } return canonicalFileName; } }