Java URL Connection getDefaultUrlConnection(URL url)

Here you can find the source of getDefaultUrlConnection(URL url)

Description

get Default Url Connection

License

Open Source License

Declaration

private static URLConnection getDefaultUrlConnection(URL url) throws IOException 

Method Source Code

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

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

public class Main {
    private static URLConnection getDefaultUrlConnection(URL url) throws IOException {
        final URLConnection connection = (URLConnection) url.openConnection();
        connection.setRequestProperty("User-Agent",
                "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31");
        return connection;
    }//www.  ja  v  a  2 s.c o  m
}

Related

  1. getConnection(URL url)
  2. getConnectionResponseHeaders(URLConnection c)
  3. getContainerUrl(URL url, String resourceInThatDir)
  4. getCookies(URLConnection conn, Map> store)
  5. getDataFromServer(URL url)
  6. getFeedReader(URL feedUrl)
  7. getFromUrl(String url)
  8. getGlobalAddress(String url)
  9. getGlobalIPAddress(URL automationPage)