Java Path to URL url(final String path)

Here you can find the source of url(final String path)

Description

url

License

Apache License

Declaration

public static URL url(final String path) 

Method Source Code


//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);
        }
    }
}

Related

  1. toUrl(final String path)
  2. toURL(String path)
  3. toURL(String pathPrefix, String jar)
  4. toURLs(String... paths)
  5. toURLs(String[] classPath)
  6. url(String path)
  7. url(String protocol, String host, int port, String path)