class CommonUtils {

    public static String doHttpGet(final String url) {
        CloseableHttpClient httpclient = null;
        try {

            if (url.contains(HTTPS)) {

                SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(createNoSSLContext());
                httpclient = HttpClients.custom().setSSLSocketFactory(sslsf).build();
            } else {
                httpclient = HttpClients.custom().build();
            }
            HttpGet httpGet = new HttpGet(url);
            if(AuthManager.getToken()!=null){
                String accessToken =  AuthManager.getToken();
                if(!Strings.isNullOrEmpty(accessToken))
                {
                    httpGet.setHeader(PacmanSdkConstants.AUTH_HEADER, "Bearer " + accessToken);
                }
            }
            
            httpGet.setHeader(CONTENT_TYPE, APPLICATION_JSON);
            CloseableHttpResponse response = httpclient.execute(httpGet);
            return EntityUtils.toString(response.getEntity());
        } catch (Exception exception) {
            LOGGER.error("Exception in getHttpGet: " + exception.getMessage());
        } finally {
            if (null != httpclient) {
                try {
                    httpclient.close();
                } catch (IOException e) {
                    LOGGER.error("error closing http client", e);
                    httpclient = null;
                }
            }
        }

        return null;
    }

}