Class JsonDateReader


  • public class JsonDateReader
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static JsonReader<java.util.Date> Dropbox
      A parser for dates returned by the Dropbox API.
      static JsonReader<java.util.Date> DropboxV2
      A parser for dates returned by the Dropbox V2 API.
      static java.util.TimeZone UTC  
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonDateReader()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int getMonthIndex​(char a, char b, char c)  
      static boolean isValidDayOfWeek​(char a, char b, char c)  
      static java.util.Date parseDropbox8601Date​(char[] buffer, int offset, int length)  
      static java.util.Date parseDropboxDate​(char[] buffer, int offset, int length)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • Dropbox

        public static final JsonReader<java.util.Date> Dropbox
        A parser for dates returned by the Dropbox API.
      • UTC

        public static final java.util.TimeZone UTC
      • DropboxV2

        public static final JsonReader<java.util.Date> DropboxV2
        A parser for dates returned by the Dropbox V2 API. This parses only the new ISO 8601 format (e.g. "2010-01-01T12:00:00Z" or "2010-01-01T12:00:00.000Z").
    • Constructor Detail

      • JsonDateReader

        public JsonDateReader()
    • Method Detail

      • parseDropboxDate

        public static java.util.Date parseDropboxDate​(char[] buffer,
                                                      int offset,
                                                      int length)
                                               throws java.text.ParseException
        Throws:
        java.text.ParseException
      • isValidDayOfWeek

        public static boolean isValidDayOfWeek​(char a,
                                               char b,
                                               char c)
      • getMonthIndex

        public static int getMonthIndex​(char a,
                                        char b,
                                        char c)
      • parseDropbox8601Date

        public static java.util.Date parseDropbox8601Date​(char[] buffer,
                                                          int offset,
                                                          int length)
                                                   throws java.text.ParseException
        Throws:
        java.text.ParseException