Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.nntp
Class NNTPDate

java.lang.Object
  extended by com.jivesoftware.forum.nntp.NNTPDate

public class NNTPDate
extends java.lang.Object

Reads and writes NNTP standard dates. This utility class provides several mechanisms for reading, writing, and manipulating NNTP dates in the Java language. There are several standard NNTP date formats floating around. Since we are the server and control all dates, we will stick with the standard outlook date format which uses UTC offset. As an added bonus, this format also follows Java standard timezone format.


Constructor Summary
NNTPDate(java.util.Date newDate)
          Create a new date using the given Java java.util.Date class.
 
Method Summary
static NNTPDate parseDate(java.lang.String dateString)
          Parse a date from the given NNTP string representation.
static NNTPDate parseDateTimeDist(java.lang.String[] cmdParts, int index, NewsGroupFilter filter)
          Parse a date as it appears on an NNTP command line or header field.
static NNTPDate parseGMTDate(java.lang.String dateString)
          Parse a date from the given GMT NNTP string representation.
 java.util.Date toDate()
          Converts the date to a Java Date class.
 java.lang.String toString()
          Converts this date into it's standard NNTP String representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NNTPDate

public NNTPDate(java.util.Date newDate)
Create a new date using the given Java java.util.Date class.

Parameters:
newDate - the date this date should use.
Method Detail

parseDate

public static NNTPDate parseDate(java.lang.String dateString)
                          throws SyntaxException
Parse a date from the given NNTP string representation. This method assumes the date refers to a local server timezone.

Parameters:
dateString - the date string to parse.
Returns:
an NNTPDate representing that date.
Throws:
SyntaxException - if the date does not follow a recognized format.

parseGMTDate

public static NNTPDate parseGMTDate(java.lang.String dateString)
                             throws SyntaxException
Parse a date from the given GMT NNTP string representation. This method assumes the date refers to the GMT timezone. The "GMT" string should NOT be included in the date string.

Parameters:
dateString - the date string to parse
Returns:
an NNTPDate representing that date
Throws:
SyntaxException - if the date does not follow a recognized format

parseDateTimeDist

public static NNTPDate parseDateTimeDist(java.lang.String[] cmdParts,
                                         int index,
                                         NewsGroupFilter filter)
                                  throws SyntaxException
Parse a date as it appears on an NNTP command line or header field. The date string should be split along whitespace into a string array. This command is only used with the NEWGROUPS command so any trailing distribution list information is also appended to the given group filter. When the usage of this method expands this functionality should be split out of this method.

Parameters:
cmdParts - an array of strings containing the date split along whitespace.
index - the index in the cmdParts array that the date begins.
filter - the group filter to add any trailing group distributions to.
Returns:
the parsed date.
Throws:
SyntaxException - if the string does not match a known NNTP date format.

toDate

public java.util.Date toDate()
Converts the date to a Java Date class.

Returns:
the Java Date class representation of this date.

toString

public java.lang.String toString()
Converts this date into it's standard NNTP String representation

Overrides:
toString in class java.lang.Object
Returns:
the NNTP string representation of this date.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.