Here you can find the source of isValidURLWithoutProtocol(String value)
Parameter | Description |
---|---|
value | The URL to validate |
public static boolean isValidURLWithoutProtocol(String value)
//package com.java2s; //License from project: Apache License import java.net.MalformedURLException; import java.net.URL; public class Main { /**/* w ww . j ava 2 s . c om*/ * Validate the URL without protocol * * @param value The URL to validate * @return True if the value is a valid URL */ public static boolean isValidURLWithoutProtocol(String value) { return isValidURL("http://" + value); } /** * Validate the URL * * @param value The URL to validate * @return True if the value is a valid URL */ public static boolean isValidURL(String value) { try { new URL(value); return true; } catch (MalformedURLException ex) { return false; } } }