public static String executeSolrCommandWithTimeout(int timeout,String command) throws IOException {
  logger.info(command);
  BufferedReader in=null;
  try {
    in=new BufferedReader(new InputStreamReader(executeSolrCommandAndGetInputStreamWithTimeout(timeout,command)));
    String inputLine;
    StringBuffer response=new StringBuffer();
    while ((inputLine=in.readLine()) != null) {
      response.append(inputLine);
    }
    in.close();
    return response.toString();
  }
  finally {
    if (in != null)     in.close();
  }
}

public static String executeSolrCommandWithTimeout ( int timeout , String command ) throws IOException { logger . info ( command ) ; BufferedReader in = null ; try { in = new BufferedReader ( new InputStreamReader ( executeSolrCommandAndGetInputStreamWithTimeout ( timeout , command ) ) ) ; String inputLine ; StringBuffer response = new StringBuffer ( ) ; while ( ( inputLine = in . readLine ( ) ) != null ) { response . append ( inputLine ) ; } in . close ( ) ; return response . toString ( ) ; } finally { if ( in != null ) in . close ( ) ; } }
execute a solr api call through http
