class HeaderUtils {

    public static Integer extractIntegerHeader(HttpResponse response, ResponseHeader responseHeader) {
        NumberFormat numberFormat = NumberFormat.getInstance(Locale.US);
        numberFormat.setParseIntegerOnly(true);

        String headerValue = extractHeader(response, responseHeader);
        try {
            Number value = numberFormat.parse(headerValue.trim());
            return value.intValue();
        } catch (Exception e) {
            return null;
        }
    }

}