Here you can find the source of isFileURL(URL url)
Parameter | Description |
---|---|
url | the URL to check |
public static boolean isFileURL(URL url)
//package com.java2s; //License from project: LGPL import java.net.URL; public class Main { /** URL protocol for a file in the file system: "file" */ public static final String URL_PROTOCOL_FILE = "file"; /** URL protocol for a JBoss VFS resource: "vfs" */ public static final String URL_PROTOCOL_VFS = "vfs"; /**//from w w w . j a v a2 s. c o m * Determine whether the given URL points to a resource in the file system, * that is, has protocol "file" or "vfs". * @param url the URL to check * @return whether the URL has been identified as a file system URL */ public static boolean isFileURL(URL url) { String protocol = url.getProtocol(); return (URL_PROTOCOL_FILE.equals(protocol) || protocol.startsWith(URL_PROTOCOL_VFS)); } }