package com.inspect.exec.util;

import java.io.IOException;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;

public class HttpClientUtil {
   public static String getHttpResultJson(String url) {
      HttpClient httpclient = new DefaultHttpClient();
      HttpGet httpget = new HttpGet(url);
      String json = null;

      try {
         HttpResponse response = httpclient.execute(httpget);
         HttpEntity entity = response.getEntity();
         if(entity != null) {
            json = EntityUtils.toString(entity, "UTF-8").trim();
         }
      } catch (ClientProtocolException var10) {
         var10.printStackTrace();
      } catch (IOException var11) {
         var11.printStackTrace();
      } finally {
         httpget.abort();
      }

      return json;
   }
}
