Package org.apache.james.mime4j.field.datetime.parser

Examples of org.apache.james.mime4j.field.datetime.parser.DateTimeParser$Time


    }

    public void setNotAfter(
        Date    date)
    {
        tbsGen.setEndDate(new Time(date));
    }
View Full Code Here


        // Issuer info
        v3certGen.setIssuer(caName);
        // serial number
        v3certGen.setSerialNumber(new DERInteger(serialNum));
        // validity
        v3certGen.setStartDate(new Time(validFromDate));
        v3certGen.setEndDate(new Time(validToDate));
        // signature algorithm
        v3certGen.setSignature(algId);
       
        // Get the certificate info to be signed
        TBSCertificateStructure tbsCert = v3certGen.generateTBSCertificate();
View Full Code Here

        // Issuer info
        v3certGen.setIssuer(caName);
        // serial number
        v3certGen.setSerialNumber(new DERInteger(serialNum));
        // validity
        v3certGen.setStartDate(new Time(validFromDate));
        v3certGen.setEndDate(new Time(validToDate));
        // signature algorithm
        v3certGen.setSignature(algId);
       
        // Get the certificate info to be signed
        TBSCertificateStructure tbsCert = v3certGen.generateTBSCertificate();
View Full Code Here

    }

    public void setNotBefore(
        Date    date)
    {
        tbsGen.setStartDate(new Time(date));
    }
View Full Code Here

    }

    public void setNotAfter(
        Date    date)
    {
        tbsGen.setEndDate(new Time(date));
    }
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) {
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

        return value;
    }

    private static 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

            monitor.warn("Parsing " + paramName + " null", "returning null");
            return null;
        }

        try {
            return new DateTimeParser(new StringReader(value)).parseAll()
                    .getDate();
        } catch (org.apache.james.mime4j.field.datetime.parser.ParseException e) {
            if (monitor.isListening()) {
                monitor.warn(paramName + " parameter is invalid: " + value,
                        paramName + " parameter is ignored");
View Full Code Here

    private void parse() {
        String body = getBody();

        try {
            date = new DateTimeParser(new StringReader(body)).parseAll()
                    .getDate();
        } catch (ParseException e) {
            parseException = e;
        } catch (TokenMgrError e) {
            parseException = new ParseException(e.getMessage());
View Full Code Here

TOP

Related Classes of org.apache.james.mime4j.field.datetime.parser.DateTimeParser$Time

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.