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

booleanisURL(final String urlString)
Check if a URL is actually a URL
try {
    new URL(urlString);
} catch (Exception e) {
    return false;
return true;
booleanisURL(Object obj)
is URL
try {
    new URL(obj.toString());
    return true;
} catch (Exception e) {
    return false;
booleanisUrl(String input)
is Url
String urlString;
if (input.startsWith("http://")) {
    urlString = input;
} else {
    urlString = "http://" + input;
try {
    URL url = new URL(urlString);
...
booleanisURL(String name)
is URL
try {
    new URL(name);
    return true;
} catch (Exception e) {
    return false;
booleanisURL(String possibleURL)
Check if string is a valid URL.
boolean result = false;
try {
    URL url = new URL(possibleURL);
    result = true;
} catch (Exception e) {
return result;
booleanisUrl(String resourceLocation)
Return whether the given resource location is a URL: either a special "classpath" pseudo URL or a standard URL.
if (resourceLocation.startsWith(CLASSPATH_URL_PREFIX)) {
    return true;
try {
    new URL(resourceLocation);
    return true;
} catch (MalformedURLException ex) {
    return false;
...
booleanisUrl(String resourceLocation)
is Url
if (resourceLocation == null) {
    return false;
} else if (resourceLocation.startsWith("classpath:")) {
    return true;
} else {
    try {
        new URL(resourceLocation);
        return true;
...
booleanisUrl(String s)
is Url
s = s.trim();
boolean missingScheme = false;
if (!scheme.matcher(s).find()) {
    return false; 
try {
    URL u = new URL(s);
    return true;
...
booleanisUrl(String s)
is Url
if (true) {
    try {
        URL u = new URL(s);
        return (u != null);
    } catch (MalformedURLException e) {
        return false;
} else {
...
booleanisURL(String str)
is URL
if (str.startsWith("http:") || str.startsWith("https:") || str.startsWith("file:") || str.startsWith("ftp:")
        || str.startsWith("soap:")) {
    return true;
try {
    new java.net.URL(str); 
    return true;
} catch (java.net.MalformedURLException e) {
...