Here you can find the source of isWellFormedURL(String url_str)
static public boolean isWellFormedURL(String url_str)
//package com.java2s; /******************************************************************************* * Copyright (c) 2005-2011 eBay Inc./*from ww w .j ava2 s . c o m*/ * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * *******************************************************************************/ import java.net.MalformedURLException; import java.net.URL; public class Main { /** * Check if specified string is well formed */ static public boolean isWellFormedURL(String url_str) { if (url_str == null) return false; try { new URL(url_str); return true; } catch (MalformedURLException e) { return false; } } }