View Javadoc
1 /* 2 * Copyright (C) The Apache Software Foundation. All rights reserved. 3 * 4 * This software is published under the terms of the Apache Software License 5 * version 1.1, a copy of which has been included with this distribution in 6 * the LICENSE file. 7 */ 8 package org.apache.james.util; 9 10 import java.util.Date; 11 import javax.mail.internet.MailDateFormat; 12 13 /*** 14 * A thread safe wrapper for the <code>javax.mail.internet.MailDateFormat</code> class. 15 * 16 * @author Serge Knystautas <sergek@lokitech.com> 17 * @author Peter M. Goldstein <farsight@alum.mit.edu> 18 */ 19 public class RFC822DateFormat extends SynchronizedDateFormat { 20 /*** 21 * A static instance of the RFC822DateFormat, used by toString 22 */ 23 private static RFC822DateFormat instance; 24 25 static { 26 instance = new RFC822DateFormat(); 27 } 28 29 /*** 30 * This static method allows us to format RFC822 dates without 31 * explicitly instantiating an RFC822DateFormat object. 32 * 33 * @return java.lang.String 34 * @param d Date 35 * 36 * @deprecated This method is not necessary and is preserved for API 37 * backwards compatibility. Users of this class should 38 * instantiate an instance and use it as they would any 39 * other DateFormat object. 40 */ 41 public static String toString(Date d) { 42 return instance.format(d); 43 } 44 45 /*** 46 * Constructor for RFC822DateFormat 47 */ 48 public RFC822DateFormat() { 49 super(new MailDateFormat()); 50 } 51 }

This page was automatically generated by Maven