Java tutorial
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.IOException; public class Main { /** * A 'checked exception free' version of {@link File#getCanonicalPath()}. */ public static String canonicalPath(File file) { try { return file.getCanonicalPath(); } catch (final IOException e) { throw new RuntimeException(e); } } }