Here you can find the source of url(final String path)
public static URL url(final String path)
//package com.java2s; //License from project: Apache License import java.net.MalformedURLException; import java.net.URL; import com.google.common.base.Throwables; public class Main { public static URL url(final String path) { try {/* www . jav a 2s .c o m*/ return new URL(path); } catch (MalformedURLException e) { throw Throwables.propagate(e); } } }