Java URLConnection Create openConnection(final URL url)

Here you can find the source of openConnection(final URL url)

Description

open Connection

License

Open Source License

Declaration

private static URLConnection openConnection(final URL url) throws IOException 

Method Source Code


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

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

public class Main {
    private static URLConnection openConnection(final URL url) throws IOException {
        URLConnection conn = url.openConnection();
        conn.setReadTimeout(3000);/*from w w  w .  jav a  2  s.  co  m*/
        conn.setDefaultUseCaches(false);
        conn.setUseCaches(false);
        return conn;
    }
}

Related

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