Here you can find the source of createHttpURLGetConnection(String url, int timeout)
Parameter | Description |
---|---|
url | a parameter |
timeout | a parameter |
trustStorePws | A password which is used to authenticate with iRubric server |
Parameter | Description |
---|
public static HttpURLConnection createHttpURLGetConnection(String url, int timeout) throws IOException
//package com.java2s; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; public class Main { /**//from w ww .j ava 2 s . c om * Create an HTTP GET connection with the specified URL * * @param url * @param timeout * @param trustStorePws * A password which is used to authenticate with iRubric server * @return An HTTP connection * @throws java.io.IOException */ public static HttpURLConnection createHttpURLGetConnection(String url, int timeout) throws IOException { HttpURLConnection connection = null; URL serverAddress = null; serverAddress = new URL(url); connection = (HttpURLConnection) serverAddress.openConnection(); connection.setRequestMethod("GET"); connection.setDoOutput(true); connection.setReadTimeout(timeout); connection.connect(); return connection; } }