HttpClient client = new HttpClient();
GetMethod method = new GetMethod(url);
client.getHttpConnectionManager().getParams().setConnectionTimeout(3000);
client.getHttpConnectionManager().getParams().setConnectionTimeout(3000);
method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
new DefaultHttpMethodRetryHandler(1, false));
try {
int statusCode = client.executeMethod(method);
if (statusCode != HttpStatus.SC_OK) {
//System.err.println("Method failed: " + method.getStatusLine());