class DefaultHttpHeaderManager implements HttpHeaderManager {

    @Override
    public long getDateHeader(String name) throws IllegalArgumentException {
        long result = -1;
        if (headers.containsKey(name.toUpperCase(locale))) {
            DefaultHttpHeader header = headers.get(name.toUpperCase(locale));
            try {
                String value = header.getValue();
                SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz");
                result = format.parse(value).getTime();
            } catch (ParseException exception) {
                throw new IllegalArgumentException(
                        "Cannot convert header to a date", exception);
            }
        }
        return result;
    }

    public  DefaultHttpHeaderManager();

}