com.funambol.email.util
Class UtilityDate

java.lang.Object
  extended by com.funambol.email.util.UtilityDate

public class UtilityDate
extends java.lang.Object

Utility class


Field Summary
protected static com.funambol.framework.logging.FunambolLogger log
           
 
Constructor Summary
UtilityDate()
           
 
Method Summary
static java.util.Date dateStringToDate(java.lang.String s, java.lang.String subj)
          this method always returns a Date value.
static java.util.Date formatter(java.lang.String s)
           
static java.util.Date getDateForTimeFilter(javax.mail.Message message, java.util.Locale loc)
           
static java.util.Date getHeaderDate(javax.mail.Message message, java.util.Locale loc)
          Returns an origination date in UTC format
static java.lang.String getHeaderDateNowPatch()
          this is a fix for all strange date format; it returns the NOW value.
static java.util.Date getHeaderReceived(javax.mail.Message message)
           
static boolean isHeaderDateParsable(javax.mail.Message message)
          Returns true if the date is parsable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static com.funambol.framework.logging.FunambolLogger log
Constructor Detail

UtilityDate

public UtilityDate()
Method Detail

getHeaderDate

public static java.util.Date getHeaderDate(javax.mail.Message message,
                                           java.util.Locale loc)
                                    throws EntityException
Returns an origination date in UTC format

Available Date Parser

pat_1: Exchange 2003 (eng): wed, 6 Oct 2005 09:46:47 +0200

pat_2: Exchange 2000 (eng): 6 Oct 2005 09:46:47 +0200

pat_3: BB client : Wed Dec 28 20:05:53 GMT 2005

pat_4: ?? : Wed Dec 28 20:05:53 2005

Parameters:
message - Message
loc - Locale
Returns:
date in the header Date
Throws:
EntityException

getHeaderReceived

public static java.util.Date getHeaderReceived(javax.mail.Message message)
Parameters:
message - Message
Returns:
String

isHeaderDateParsable

public static boolean isHeaderDateParsable(javax.mail.Message message)
Returns true if the date is parsable

Parameters:
message - Message
Returns:
true if the header date is parsable

getDateForTimeFilter

public static java.util.Date getDateForTimeFilter(javax.mail.Message message,
                                                  java.util.Locale loc)
Parameters:
message - Message
Returns:
String

getHeaderDateNowPatch

public static java.lang.String getHeaderDateNowPatch()
this is a fix for all strange date format; it returns the NOW value.


dateStringToDate

public static java.util.Date dateStringToDate(java.lang.String s,
                                              java.lang.String subj)
                                       throws EntityException
this method always returns a Date value. if the parser returns a null value, it applies the getHeaderDatePatch3(). the getHeaderDatePatch3() method returns the NOW value. it's public for testing purpose

Throws:
EntityException

formatter

public static java.util.Date formatter(java.lang.String s)
                                throws EntityException
Throws:
EntityException


Copyright © 2005-2006 Funambol.