Here you can find the source of isLocalFile(URL url)
Adapted from http://www.java2s.com/Code/Java/Network-Protocol/IsURLalocalfile.htm
Parameter | Description |
---|---|
url | a parameter |
private static boolean isLocalFile(URL url)
//package com.java2s; //License from project: Apache License import java.net.URL; public class Main { /**/*from ww w .jav a 2 s. co m*/ * Adapted from http://www.java2s.com/Code/Java/Network-Protocol/IsURLalocalfile.htm * @param url * @return */ private static boolean isLocalFile(URL url) { return ((url.getProtocol().equals("file")) && (url.getHost() == null || url.getHost().equals(""))); } }