Here you can find the source of isSame(File file1, File file2)
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 { public static boolean isSame(File file1, File file2) { return canonicalFile(file1).equals(canonicalFile(file2)); }// w w w.j av a2s . c o m public static boolean equals(File fileA, File fileB) { return canonicalFile(fileA).equals(canonicalFile(fileB)); } /** * 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); } } }