Please note the following questions/comments regarding DateParser.

Mike

Begin forwarded message:

From: "Christopher Brown" <[EMAIL PROTECTED]>
Date: Tue Jun 10, 2003  5:34:51 AM US/Eastern
To: "Michael Becke" <[EMAIL PROTECTED]>
Subject: org.apache.commons.httpclient.util.DateParser


Hi Michael,


It's nice to see how you've implemented the DateParser stuff in HttpClient
beta-1. Just some suggestions if you've got time (I'd like to contribute
more than ideas, but I really regret not having the time...).


The "private static final String[] DATE_PATTERNS" might be more efficiently
declared as an array of DateFormat instances (never publicly accessible, as
that could be tampered with using the "apply" method for example), as that
avoids repeat parsing of the date format pattern.


Other comment: it might be worth implementing a "getLastModified" method in
HttpMethodBase (or even declaring it in the HttpMethod interface) so that
common functionality (common with java.net.HttpURLConnection) can be
provided. This would simply parse the value of the "Last-Modified" response
header (if present) by delegating to this method.


Going further, it might be worth providing a method in DateParser that uses
the "java.text.DateFormat.format(java.util.Date)" method to format request
headers ("public static String DateParse.toDateHeader(Date)" ?), such as
If-Modified-Since, and even implementing convenience methods on some Method
implementations to apply the appropriate headers that translates
"java.util.Date" objects or "long" values into a date header.


Feel free to forward this onto the mailing list if you think it merits
further discussion.

- Christopher Brown




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to