commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oglu...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient Cookie.java
Date Fri, 11 Oct 2002 07:37:46 GMT
oglueck     2002/10/11 00:37:46

  Modified:    httpclient/src/java/org/apache/commons/httpclient
                        Cookie.java
  Log:
  more date formats by Justin Bedard
  
  Revision  Changes    Path
  1.23      +15 -22    jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/Cookie.java
  
  Index: Cookie.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/Cookie.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- Cookie.java	24 Sep 2002 01:59:34 -0000	1.22
  +++ Cookie.java	11 Oct 2002 07:37:46 -0000	1.23
  @@ -1090,29 +1090,22 @@
      // -------------------------------------------------------------- Constants
   
      /** List of valid date formats for the "expires" cookie attribute. */
  -   private static final DateFormat[] expiryFormats = new DateFormat[6];
  +   private static final DateFormat[] expiryFormats = {
  +       // RFC 1123, 822, Date and time specification is English.
  +       new SimpleDateFormat("EEE, dd-MMM-yy HH:mm:ss z", Locale.US),
  +       new SimpleDateFormat("EEE, dd-MMM-yyyy HH:mm:ss z", Locale.US),
  +       new SimpleDateFormat("EEE dd-MMM-yy HH:mm:ss z", Locale.US),
  +       new SimpleDateFormat("EEE dd-MMM-yyyy HH:mm:ss z", Locale.US),
  +       new SimpleDateFormat("EEE dd MMM yy HH:mm:ss z", Locale.US),
  +       new SimpleDateFormat("EEE dd MMM yyyy HH:mm:ss z", Locale.US),
  +       new SimpleDateFormat("EEE, dd MMM yy HH:mm:ss z", Locale.US),
  +       new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US)
  +   };
   
      /** Collator for Cookie comparisons.  Could be replaced with references to specific
Locales. */
      private static final RuleBasedCollator stringCollator =
           (RuleBasedCollator)RuleBasedCollator.getInstance(
                                                   new Locale("en", "US", ""));
  -
  -   /** Static initializer for {@link #expiryFormats} constant. */
  -   static {
  -       // RFC 1123, 822, Date and time specification is English.
  -       expiryFormats[0] = new SimpleDateFormat("EEE, dd-MMM-yy HH:mm:ss z",
  -                                               Locale.US);
  -       expiryFormats[1] = new SimpleDateFormat("EEE, dd-MMM-yyyy HH:mm:ss z",
  -                                               Locale.US);
  -       expiryFormats[2] = new SimpleDateFormat("EEE dd-MMM-yy HH:mm:ss z",
  -                                               Locale.US);
  -       expiryFormats[3] = new SimpleDateFormat("EEE dd-MMM-yyyy HH:mm:ss z",
  -                                               Locale.US);
  -       expiryFormats[4] = new SimpleDateFormat("EEE dd MMM yy HH:mm:ss z",
  -                                               Locale.US);
  -       expiryFormats[5] = new SimpleDateFormat("EEE dd MMM yyyy HH:mm:ss z",
  -                                               Locale.US);
  -   }
   
      /** Log object for this class */
      private static final Log log = LogFactory.getLog(Cookie.class);
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message