Java URL Value Check isUrl(String resourceLocation)

Here you can find the source of isUrl(String resourceLocation)

Description

is Url

License

Apache License

Declaration

public static boolean isUrl(String resourceLocation) 

Method Source Code

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

import java.net.MalformedURLException;

import java.net.URL;

public class Main {
    public static boolean isUrl(String resourceLocation) {
        if (resourceLocation == null) {
            return false;
        } else if (resourceLocation.startsWith("classpath:")) {
            return true;
        } else {/*  w  w  w . j a v a2 s .  co  m*/
            try {
                new URL(resourceLocation);
                return true;
            } catch (MalformedURLException var2) {
                return false;
            }
        }
    }
}

Related

  1. isURL(Object obj)
  2. isUrl(String input)
  3. isURL(String name)
  4. isURL(String possibleURL)
  5. isUrl(String resourceLocation)
  6. isUrl(String s)
  7. isUrl(String s)
  8. isURL(String str)
  9. isURL(String token)