Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.io.IOException;

import java.net.HttpURLConnection;

import java.net.URL;

public class Main {

    private static HttpURLConnection getHttpURLConnection(String strURL) throws IOException {
        URL url = new URL(strURL);
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setConnectTimeout(10000);
        conn.setReadTimeout(15000);
        return conn;
    }
}