public static InputStream executeSolrCommandAndGetInputStreamWithTimeout(int timeout,String command) throws IOException {
  URL obj=new URL(command);
  HttpURLConnection con=(HttpURLConnection)obj.openConnection();
  con.setRequestMethod("GET");
  con.setConnectTimeout(timeout);
  con.setReadTimeout(timeout);
  return con.getInputStream();
}

public static InputStream executeSolrCommandAndGetInputStreamWithTimeout ( int timeout , String command ) throws IOException { URL obj = new URL ( command ) ; HttpURLConnection con = ( HttpURLConnection ) obj . openConnection ( ) ; con . setRequestMethod ( "GET" ) ; con . setConnectTimeout ( timeout ) ; con . setReadTimeout ( timeout ) ; return con . getInputStream ( ) ; }
execute a http command with a given read timeout
