Here you can find the source of isFileURL(URL url)
true
if specified URL is a file: URL, otherwise returns false
public static boolean isFileURL(URL url)
//package com.java2s; import java.net.URL; public class Main { /**/*from ww w .j av a 2 s . c o m*/ * Returns <code>true</code> if specified URL is a <tt>file:</tt> URL, * otherwise returns <code>false</code> */ public static boolean isFileURL(URL url) { return "file".equals(url.getProtocol()); } }