Java URL Value Check is200(final String url)

Here you can find the source of is200(final String url)

Description

is

License

Open Source License

Declaration

public static boolean is200(final String url) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.net.HttpURLConnection;
import java.net.URL;

public class Main {

    public static boolean is200(final String url) {
        HttpURLConnection con = null;
        try {/* ww  w .  ja  v  a  2 s.  c o  m*/
            con = (HttpURLConnection) new URL(url).openConnection();
            return (con.getResponseCode() == 200);
        } catch (Exception e) {
            return false;
        } finally {
            if (con != null) {
                con.disconnect();
            }
        }
    }
}

Related

  1. checkUrlImage(final String url)
  2. checkURLStatus(String pURL)
  3. checkURLValidProtocol(URL url)
  4. invokePostUrl(String url, String encodedQueryString)
  5. invokeUrl(String url)
  6. is404(URL url)
  7. isAddressReachable(String url, int timeout)
  8. isAValidURL(String url)
  9. isCompressed(HttpURLConnection connection)