Here you can find the source of isSame(File file1, File file2)
true
if the canonical files passed as arguments have the same canonical file.
public static boolean isSame(File file1, File file2)
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.IOException; public class Main { /**/*from ww w. j av a 2s . co m*/ * Returns <code>true</code> if the canonical files passed as arguments have * the same canonical file. */ public static boolean isSame(File file1, File file2) { return canonicalFile(file1).equals(canonicalFile(file2)); } /** * A 'checked exception free' version of {@link File#getCanonicalFile()}. */ public static File canonicalFile(File file) { try { return file.getCanonicalFile(); } catch (final IOException e) { throw new RuntimeException(e); } } }