Here you can find the source of isUrl(String s)
public static boolean isUrl(String s)
//package com.java2s; //License from project: CDDL license import java.net.URL; import java.net.MalformedURLException; public class Main { public static boolean isUrl(String s) { if (true) { try { URL u = new URL(s); return (u != null); } catch (MalformedURLException e) { return false; }/*ww w . j a v a 2 s .c o m*/ } else { if (s == null) return false; s = s.toLowerCase(); if (s.startsWith("http://")) return true; else if (s.startsWith("ftp://")) return true; else if (s.startsWith("file:")) return true; // what other forms does java url handle? else return false; } } }