List of utility methods to do URL Value Check
boolean | isValidUrlDataType(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; |
boolean | isValidURLWithoutProtocol(String value) Validate the URL without protocol return isValidURL("http://" + value); |
boolean | isVersionCompatible(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) { ... |
boolean | isWellFormedURL(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; |