code: public static boolean isFileURL(URL url) {
          String protocol = url.getProtocol();
          return (URL_PROTOCOL_FILE.equals(protocol) || protocol.startsWith(URL_PROTOCOL_VFS));
      }
docs: 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