Here you can find the source of isURL(String possibleURL)
Parameter | Description |
---|---|
possibleURL | String to check for being a URL. |
public static boolean isURL(String possibleURL)
//package com.java2s; /* Please see the license information at the end of this file. */ import java.net.*; public class Main { /** Check if string is a valid URL. *//w w w . j a va2 s.c om * @param possibleURL String to check for being a URL. * * @return true if string is a URL. */ public static boolean isURL(String possibleURL) { boolean result = false; try { URL url = new URL(possibleURL); result = true; } catch (Exception e) { } return result; } }