class CommonUtils {

    public static boolean isValidResource(String esUrl) {
        HttpClient httpclient = HttpClientBuilder.create().build();
        HttpHead httpHead = new HttpHead(esUrl);
        HttpResponse response;
        try {
            response = httpclient.execute(httpHead);
            return HttpStatus.SC_OK == response.getStatusLine().getStatusCode();
        } catch (ClientProtocolException clientProtocolException) {
            LOGGER.error("ClientProtocolException in getHttpHead:" + clientProtocolException);
        } catch (IOException ioException) {
            LOGGER.error("IOException in getHttpHead:" + ioException);
        }
        return false;
    }

}