Java URL Create createURL(String urlString)

Here you can find the source of createURL(String urlString)

Description

Create a URL from a string.

License

Open Source License

Parameter

Parameter Description
urlString String representing the URL.

Exception

Parameter Description
MalformedURLException an exception

Return

URL java.lang.URL representation of the URL.

Declaration

public static final URL createURL(String urlString) throws MalformedURLException 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2001, 2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:/*from w ww. j  a v a 2  s  .c  o m*/
 * IBM Corporation - initial API and implementation
 *******************************************************************************/

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

public class Main {
    /**
     * Create a URL from a string.
     * @param urlString String representing the URL.
     * @return URL java.lang.URL representation of the URL.
     * @throws MalformedURLException
     */
    public static final URL createURL(String urlString) throws MalformedURLException {
        return new URL(urlString);
    }
}

Related

  1. createURL(String str)
  2. createURL(String url)
  3. createURL(String url)
  4. createURL(String url)
  5. createURL(String url, String baseURI)
  6. toUrl(String filename)
  7. toURL(String port, String address, String table)
  8. toURL(String protocol, String host, int port, String path)
  9. toUrl(String s)