Java URLConnection Create openConnection(String urlPath)

Here you can find the source of openConnection(String urlPath)

Description

open Connection

License

LGPL

Declaration

public static URLConnection openConnection(String urlPath) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.io.IOException;

import java.io.UncheckedIOException;
import java.net.URL;
import java.net.URLConnection;

public class Main {
    public static URLConnection openConnection(String urlPath) {
        try {//from w w w  . j  a va2  s  .  c  o m
            URL url = new URL(urlPath);
            return url.openConnection();
        } catch (IOException ex) {
            throw new UncheckedIOException(ex);
        }
    }
}

Related

  1. createConnection(URL url, Proxy proxy)
  2. getURLConnection(String uri)
  3. getUrlConnection(String urlString)
  4. getURLConnection(URL url)
  5. openConnection(final URL url)
  6. openConnection(URL localURL)
  7. openConnection(URL url)
  8. openConnection(URL url)
  9. openConnection(URL url)