public static String tryGetCanonicalPathElseGetAbsolutePath ( File file ) { try { return file . getCanonicalPath ( ) ; } catch ( IOException ignore ) { return file . getAbsolutePath ( ) ; } }
Attempts to the get the canonical path of the given file otherwise returns the absolute path of the file .