Java Utililty Methods URL Value Check

List of utility methods to do URL Value Check

Description

The list of methods to do URL Value Check are organized into topic(s).

Method

booleanisValidUrlDataType(URL value)
is Valid Url Data Type
if (value == null)
    return false;
else if (!"http".equals(value.getProtocol()))
    return false;
else
    return value.toString().length() < 256;
booleanisValidURLWithoutProtocol(String value)
Validate the URL without protocol
return isValidURL("http://" + value);
booleanisVersionCompatible(URL url)
Checks if the Studio version supports the latest Cloud manager.
try {
    URLConnection connection = url.openConnection();
    connection.setReadTimeout(TIMEOUT);
    if (connection instanceof HttpURLConnection) {
        HttpURLConnection httpConn = (HttpURLConnection) connection;
        httpConn.setRequestMethod("GET"); 
        int status = httpConn.getResponseCode();
        if (status == 410) {
...
booleanisWellFormedURL(String url_str)
Check if specified string is well formed
if (url_str == null)
    return false;
try {
    new URL(url_str);
    return true;
} catch (MalformedURLException e) {
    return false;