Here you can find the source of isSameFile(URL u, File out)
public static boolean isSameFile(URL u, File out)
//package com.java2s; //License from project: Apache License import java.io.File; import java.net.URL; public class Main { public static boolean isSameFile(URL u, File out) { try {/*from w w w . j a v a2s . co m*/ if (u == null || out == null) return false; return out.equals(new File(u.toURI())); } catch (Throwable e) { return false; } } }