HttpClientUtil { public byte[] getFile(String url) throws Exception { CloseableHttpClient httpClient = getHttpClient(); CloseableHttpResponse response = null; try { HttpGet httpget = new HttpGet(url); response = httpClient.execute(httpget); HttpEntity entity = response.getEntity(); return EntityUtils.toByteArray(entity); } finally { response.close(); httpClient.close(); } }  String get(String url, String encoding); String get(String url); String getSSL(String url, String encoding); String getSSL(String url); String post(String url, List<NameValuePair> nvps,
			String encoding); String post(String url, List<NameValuePair> nvp); String post(String url, String content); String postSSL(String url, List<NameValuePair> nvps,
			String encoding); String postSSL(String url, List<NameValuePair> nvps); byte[] getFile(String url); String postFile(String url,String fileName,File file); void setConnectTimeout(int connectTimeout); void setConnectionRequestTimeout(int connectionRequestTimeout); void setSocketTimeout(int socketTimeout); void setHeaders(List<Header> headers); void addHeader(String name,String value);  }
@Test public void getFile() throws Exception{ HttpClientUtil httpUtil = new HttpClientUtil(); httpUtil.getFile("http: httpUtil.postFile("http: }