org.jclouds.date.internal
Class SimpleDateFormatDateService

java.lang.Object
  extended by org.jclouds.date.internal.SimpleDateFormatDateService
All Implemented Interfaces:
DateService

public class SimpleDateFormatDateService
extends Object
implements DateService

uses SimpleDateFormat internally.


Constructor Summary
SimpleDateFormatDateService()
           
 
Method Summary
 String cDateFormat()
           
 String cDateFormat(Date date)
           
 Date cDateParse(String toParse)
           
 String iso8601DateFormat()
           
 String iso8601DateFormat(Date date)
           
 Date iso8601DateOrSecondsDateParse(String toParse)
          Parse a given date in either of two iso8601 formats: "yyyy-MM-dd'T'HH:mm:ssZ" or "yyyy-MM-dd'T'HH:mm:ss.SSSZ".
 Date iso8601DateParse(String toParse)
           
 String iso8601SecondsDateFormat()
           
 String iso8601SecondsDateFormat(Date date)
           
 Date iso8601SecondsDateParse(String toParse)
           
 String rfc1123DateFormat()
           
 String rfc1123DateFormat(Date date)
           
 Date rfc1123DateParse(String toParse)
           
 String rfc822DateFormat()
           
 String rfc822DateFormat(Date date)
           
 Date rfc822DateParse(String toParse)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleDateFormatDateService

public SimpleDateFormatDateService()
Method Detail

cDateFormat

public final String cDateFormat(Date date)
Specified by:
cDateFormat in interface DateService

cDateFormat

public final String cDateFormat()
Specified by:
cDateFormat in interface DateService

cDateParse

public final Date cDateParse(String toParse)
Specified by:
cDateParse in interface DateService
Parameters:
toParse - text to parse
Returns:
parsed date

rfc822DateFormat

public final String rfc822DateFormat(Date date)
Specified by:
rfc822DateFormat in interface DateService

rfc822DateFormat

public final String rfc822DateFormat()
Specified by:
rfc822DateFormat in interface DateService

rfc822DateParse

public final Date rfc822DateParse(String toParse)
Specified by:
rfc822DateParse in interface DateService
Parameters:
toParse - text to parse
Returns:
parsed date

iso8601SecondsDateFormat

public final String iso8601SecondsDateFormat()
Specified by:
iso8601SecondsDateFormat in interface DateService

iso8601DateFormat

public final String iso8601DateFormat(Date date)
Specified by:
iso8601DateFormat in interface DateService

iso8601DateFormat

public final String iso8601DateFormat()
Specified by:
iso8601DateFormat in interface DateService

iso8601DateParse

public final Date iso8601DateParse(String toParse)
Specified by:
iso8601DateParse in interface DateService
Parameters:
toParse - text to parse
Returns:
parsed date

iso8601SecondsDateParse

public final Date iso8601SecondsDateParse(String toParse)
                                   throws IllegalArgumentException
Specified by:
iso8601SecondsDateParse in interface DateService
Parameters:
toParse - text to parse
Returns:
parsed date
Throws:
IllegalArgumentException - if the input is invalid

iso8601DateOrSecondsDateParse

public Date iso8601DateOrSecondsDateParse(String toParse)
                                   throws IllegalArgumentException
Description copied from interface: DateService
Parse a given date in either of two iso8601 formats: "yyyy-MM-dd'T'HH:mm:ssZ" or "yyyy-MM-dd'T'HH:mm:ss.SSSZ". The latter one has the timezone designator, e.g. 2014-07-23T20:53:17+0000. At least one S3 compatible blobstore uses both these formats when returning container/object metadata.

Specified by:
iso8601DateOrSecondsDateParse in interface DateService
Parameters:
toParse - The string to parse.
Returns:
the Date object of the parsed string.
Throws:
IllegalArgumentException

iso8601SecondsDateFormat

public String iso8601SecondsDateFormat(Date date)
Specified by:
iso8601SecondsDateFormat in interface DateService

rfc1123DateFormat

public final String rfc1123DateFormat(Date date)
Specified by:
rfc1123DateFormat in interface DateService

rfc1123DateFormat

public final String rfc1123DateFormat()
Specified by:
rfc1123DateFormat in interface DateService

rfc1123DateParse

public final Date rfc1123DateParse(String toParse)
                            throws IllegalArgumentException
Specified by:
rfc1123DateParse in interface DateService
Parameters:
toParse - text to parse
Returns:
parsed date
Throws:
IllegalArgumentException - if the input is invalid


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.