Here you can find the source of createURL(String url)
Parameter | Description |
---|---|
url | url string URL#URL(String) |
public static URL createURL(String url)
//package com.java2s; //License from project: Open Source License import java.net.URL; public class Main { /**/*from w w w. j a va2s.c o m*/ * converts a string into an url via the utf-8 encoder * @param url url string {@link URL#URL(String)} * @return a wrapped url or null if an exception was thrown */ public static URL createURL(String url) { try { return new URL(url); } catch (Exception e) { return null; } } }