Here you can find the source of isUrl(String resourceLocation)
public static boolean isUrl(String resourceLocation)
//package com.java2s; //License from project: Open Source License import java.net.MalformedURLException; import java.net.URL; public class Main { /** Pseudo URL prefix for loading from the class path: "classpath:" */ public static final String CLASSPATH_URL_PREFIX = "classpath:"; /**/*from w ww . j av a2s . co m*/ * Return whether the given resource location is a URL: either a special * "classpath" pseudo URL or a standard URL. * * @see #CLASSPATH_URL_PREFIX * @see java.net.URL */ public static boolean isUrl(String resourceLocation) { if (resourceLocation.startsWith(CLASSPATH_URL_PREFIX)) { return true; } try { new URL(resourceLocation); return true; } catch (MalformedURLException ex) { return false; } } }