Java URL Value Check isFile(final URL url)

Here you can find the source of isFile(final URL url)

Description

Indicates whether or not the given url is a file.

License

BSD License

Parameter

Parameter Description
url the URL to check.

Return

true/false

Declaration

public static boolean isFile(final URL url) 

Method Source Code


//package com.java2s;
//License from project: BSD License 

import java.io.File;

import java.net.URL;

public class Main {
    /**//from w  ww  .  java2 s  .  c  om
     * Indicates whether or not the given <code>url</code> is a file.
     *
     * @param url the URL to check.
     * @return true/false
     */
    public static boolean isFile(final URL url) {
        return url != null && new File(url.getFile()).isFile();
    }
}

Related

  1. is404(URL url)
  2. isAddressReachable(String url, int timeout)
  3. isAValidURL(String url)
  4. isCompressed(HttpURLConnection connection)
  5. isEMailAddress(URL url)
  6. isFile(final URL url)
  7. isFile(URL url)
  8. isFile(URL url)
  9. isFileInJar(URL resource)