@SuppressWarnings("deprecation")
    private String doHttpRequest() {
        Timeout timeoutInMillis = Timeout.ofMilliseconds((long) (timeout * 1000));
        RequestConfig config = custom()
                .setConnectionRequestTimeout(timeoutInMillis)
                .setResponseTimeout(timeoutInMillis)
                .build();
        try (CloseableHttpClient httpClient =  VespaHttpClientBuilder.custom().connectTimeout(timeoutInMillis).buildClient()) {
            URI statusUri = createStatusApiUri();
            if (debug)
                System.out.println("URI:" + statusUri);
            HttpGet request = new HttpGet(statusUri);
            request.addHeader("Connection", "Close");
            request.setConfig(config);
            CloseableHttpResponse response = httpClient.execute(request);
            HttpEntity entity = response.getEntity();
            String content = EntityUtils.toString(entity);
            if (debug)
                System.out.println("response:" + content);
            if (response.getCode() == 200) {
                return content;
            } else {
                throw new RuntimeException("Failed to get status for request " + statusUri + ": " +
                        response.getCode() + ": " + content);
            }
        } catch (IOException | ParseException e) {
            throw new RuntimeException(e);
        }
    }
Tool for getting file distribution status

@author hmusum
vespaclient-java/src/main/java/com/yahoo/vespa/filedistribution/status/FileDistributionStatusClient.java