Here you can find the source of getCanonicalPath(File inFile, boolean inThrowRuntimeException)
public static String getCanonicalPath(File inFile, boolean inThrowRuntimeException)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.IOException; public class Main { public static String getCanonicalPath(File inFile, boolean inThrowRuntimeException) { try {/*from w ww .j a v a 2 s.c o m*/ return inFile.getCanonicalPath(); } catch (final IOException e) { if (inThrowRuntimeException) { throw new RuntimeException(inFile == null ? "File is null" : e.getMessage(), e); } return null; } } }