Here you can find the source of getCanonicalFile(File f)
public static File getCanonicalFile(File f)
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static File getCanonicalFile(File f) { try {/* w w w . j a v a 2s .c om*/ return f.getCanonicalFile(); } catch (IOException e) { return f.getAbsoluteFile(); } } }