Package org.apache.james.mime4j.dom.datetime

Examples of org.apache.james.mime4j.dom.datetime.DateTime


        public int getMonth() { return month; }
        public int getDay() { return day; }
    }

  final public DateTime parseLine() throws ParseException {
DateTime dt;
    dt = date_time();
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case 1:
      jj_consume_token(1);
      break;
View Full Code Here


          {if (true) return dt;}
    throw new Error("Missing return statement in function");
  }

  final public DateTime parseAll() throws ParseException {
DateTime dt;
    dt = date_time();
    jj_consume_token(0);
          {if (true) return dt;}
    throw new Error("Missing return statement in function");
  }
View Full Code Here

      jj_la1[1] = jj_gen;
      ;
    }
    d = date();
    t = time();
            {if (true) return new DateTime(
                    d.getYear(),
                    d.getMonth(),
                    d.getDay(),
                    t.getHour(),
                    t.getMinute(),
View Full Code Here

        return value;
    }

    private Date toISODate(String value) throws ParseException {
        final StringReader reader = new StringReader(value);
        final DateTime dateTime = new DateTimeParser(reader).parseAll();
        Calendar cal = getGMT();
        cal.set(dateTime.getYear(), dateTime.getMonth() - 1, dateTime.getDay(), dateTime.getHour(),
                dateTime.getMinute(), dateTime.getSecond());
        return cal.getTime();
    }
View Full Code Here

   
    private Date getSentDate(Message<?> message) {
        final String value = getHeaderValue("Date", message);
        final StringReader reader = new StringReader(value);
        try {
            DateTime dateTime = new DateTimeParser(reader).parseAll();
            return dateTime.getDate();
        } catch (ParseException e) {
            // if we can not parse the date header we should use the internaldate as fallback
            return message.getInternalDate();
        }
    }
View Full Code Here

                   
                    if (f instanceof DateTimeField) {
                        // We need to make sure we convert it to GMT
                        final StringReader reader = new StringReader(f.getBody());
                        try {
                            DateTime dateTime = new DateTimeParser(reader).parseAll();
                            Calendar cal = getGMT();
                            cal.set(dateTime.getYear(), dateTime.getMonth() - 1, dateTime.getDay(), dateTime.getHour(), dateTime.getMinute(), dateTime.getSecond());
                            sentDate =  cal.getTime();
                           
                        } catch (org.apache.james.mime4j.field.datetime.parser.ParseException e) {
                            session.getLog().debug("Unable to parse Date header for proper indexing", e);
                            // This should never happen anyway fallback to the already parsed field
View Full Code Here

TOP

Related Classes of org.apache.james.mime4j.dom.datetime.DateTime

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.