Here you can find the source of isLocalFile(URL url)
public static boolean isLocalFile(URL url)
//package com.java2s; //License from project: LGPL import java.io.File; import java.net.URL; public class Main { public static boolean isLocalFile(URL url) { try {/* www . j a v a 2 s.c o m*/ if (url.getProtocol().equals(new File(url.getFile()).toURI().toURL().getProtocol())) { return true; } } catch (Throwable throwable) { throwable.printStackTrace(); } return false; } }