Java URL from newURL(String location)

Here you can find the source of newURL(String location)

Description

new URL

License

Open Source License

Declaration

public static URL newURL(String location) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;

import java.net.URI;
import java.net.URL;

public class Main {
    public static URL newURL(String location) throws IOException {
        return newURI(location).toURL();
    }//from w  ww  . jav  a2  s.  co m

    public static URI newURI(String location) throws IOException {
        try {
            return URI.create(location);
        } catch (IllegalArgumentException e) {
            throw new IOException("malformed uri: " + location, e);
        }
    }
}

Related

  1. makeURL(String url)
  2. makeURL(String urlstr)
  3. makeURL(String[] URLStrings)
  4. newURL(CharSequence urlString)
  5. newUrl(String href)
  6. newURL(String url)
  7. newURL(String url_name)
  8. newUrl(String urlString)