Package org.jclouds.date
Interface DateService
-
- All Known Implementing Classes:
JodaDateService,SimpleDateFormatDateService
public interface DateServiceParses and formats the ISO8601, C, and RFC822 date formats found in XML responses and HTTP response headers.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringcDateFormat()StringcDateFormat(Date date)DatecDateParse(String toParse)Stringiso8601DateFormat()Stringiso8601DateFormat(Date date)Dateiso8601DateOrSecondsDateParse(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".Dateiso8601DateParse(String toParse)Stringiso8601SecondsDateFormat()Stringiso8601SecondsDateFormat(Date dateTime)Dateiso8601SecondsDateParse(String toParse)Stringrfc1123DateFormat()Stringrfc1123DateFormat(Date date)Daterfc1123DateParse(String toParse)Stringrfc822DateFormat()Stringrfc822DateFormat(Date date)Daterfc822DateParse(String toParse)
-
-
-
Method Detail
-
cDateFormat
String cDateFormat()
-
cDateParse
Date cDateParse(String toParse) throws IllegalArgumentException
- Parameters:
toParse- text to parse- Returns:
- parsed date
- Throws:
IllegalArgumentException- if the input is invalid
-
rfc822DateFormat
String rfc822DateFormat()
-
rfc822DateParse
Date rfc822DateParse(String toParse) throws IllegalArgumentException
- Parameters:
toParse- text to parse- Returns:
- parsed date
- Throws:
IllegalArgumentException- if the input is invalid
-
iso8601SecondsDateFormat
String iso8601SecondsDateFormat()
-
iso8601DateFormat
String iso8601DateFormat()
-
iso8601DateParse
Date iso8601DateParse(String toParse) throws IllegalArgumentException
- Parameters:
toParse- text to parse- Returns:
- parsed date
- Throws:
IllegalArgumentException- if the input is invalid
-
iso8601SecondsDateParse
Date iso8601SecondsDateParse(String toParse) throws IllegalArgumentException
- Parameters:
toParse- text to parse- Returns:
- parsed date
- Throws:
IllegalArgumentException- if the input is invalid
-
iso8601DateOrSecondsDateParse
Date iso8601DateOrSecondsDateParse(String toParse) throws IllegalArgumentException
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.- Parameters:
toParse- The string to parse.- Returns:
- the Date object of the parsed string.
- Throws:
IllegalArgumentException
-
rfc1123DateFormat
String rfc1123DateFormat()
-
rfc1123DateParse
Date rfc1123DateParse(String toParse) throws IllegalArgumentException
- Parameters:
toParse- text to parse- Returns:
- parsed date
- Throws:
IllegalArgumentException- if the input is invalid
-
-