Java URL from makeUrl(String url)

Here you can find the source of makeUrl(String url)

Description

Creates a URL instance.

License

Open Source License

Exception

Parameter Description
RuntimeException to rethrow MalformedURLException

Declaration

public static URL makeUrl(String url) 

Method Source Code


//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

import java.net.MalformedURLException;
import java.net.URL;

public class Main {
    /**/*from w w w .  j a  v a 2s.com*/
     * Creates a URL instance.
     *
     * @throws RuntimeException to rethrow {@link MalformedURLException}
     */
    public static URL makeUrl(String url) {
        try {
            return new URL(url);
        } catch (MalformedURLException e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. makeUrl(String base, String suffix)
  2. makeURL(String id)
  3. makeURL(String location)
  4. makeURL(String title, String urlString)
  5. makeUrl(String url)
  6. makeURL(String url)
  7. makeURL(String urlstr)
  8. makeURL(String[] URLStrings)
  9. newURL(CharSequence urlString)