protected byte[] httpGet(final String url){
  HttpGet httpRequest=null;
  HttpResponse httpResponse=null;
  CloseableHttpClient client=null;
  try {
    final URI uri=new URI(url.trim());
    httpRequest=new HttpGet(uri);
    if (contentType != null) {
      httpRequest.setHeader(CONTENT_TYPE,contentType);
    }
    client=getHttpClient(url);
    httpResponse=getHttpResponse(client,httpRequest,url);
    final byte[] returnedBytes=readHttpResponse(url,httpResponse);
    return returnedBytes;
  }
 catch (  URISyntaxException e) {
    throw new DSSException(e);
  }
 finally {
    try {
      if (httpRequest != null) {
        httpRequest.releaseConnection();
      }
      if (httpResponse != null) {
        EntityUtils.consumeQuietly(httpResponse.getEntity());
      }
    }
  finally {
      closeClient(client);
    }
  }
}

protected byte [ ] httpGet ( final String url ) { HttpGet httpRequest = null ; HttpResponse httpResponse = null ; CloseableHttpClient client = null ; try { final URI uri = new URI ( url . trim ( ) ) ; httpRequest = new HttpGet ( uri ) ; if ( contentType != null ) { httpRequest . setHeader ( CONTENT_TYPE , contentType ) ; } client = getHttpClient ( url ) ; httpResponse = getHttpResponse ( client , httpRequest , url ) ; final byte [ ] returnedBytes = readHttpResponse ( url , httpResponse ) ; return returnedBytes ; } catch ( URISyntaxException e ) { throw new DSSException ( e ) ; } finally { try { if ( httpRequest != null ) { httpRequest . releaseConnection ( ) ; } if ( httpResponse != null ) { EntityUtils . consumeQuietly ( httpResponse . getEntity ( ) ) ; } } finally { closeClient ( client ) ; } } }
this method retrieves data using http or https protocol and ' get ' method .
