/** * Allows to serialize instances such that they are deserializable with the * previous implementation. * * @return the object to be serialized * @throws ObjectStreamException never */ private Object writeReplace() throws ObjectStreamException { MailDateFormat fmt = new MailDateFormat(); fmt.superApplyPattern("EEE, d MMM yyyy HH:mm:ss 'XXXXX' (z)"); fmt.setTimeZone(getTimeZone()); return fmt; }
/** * Allows to serialize instances such that they are deserializable with the * previous implementation. * * @return the object to be serialized * @throws ObjectStreamException never */ private Object writeReplace() throws ObjectStreamException { MailDateFormat fmt = new MailDateFormat(); fmt.superApplyPattern("EEE, d MMM yyyy HH:mm:ss 'XXXXX' (z)"); fmt.setTimeZone(getTimeZone()); return fmt; }
/** * Allows to serialize instances such that they are deserializable with the * previous implementation. * * @return the object to be serialized * @throws ObjectStreamException never */ private Object writeReplace() throws ObjectStreamException { MailDateFormat fmt = new MailDateFormat(); fmt.superApplyPattern("EEE, d MMM yyyy HH:mm:ss 'XXXXX' (z)"); fmt.setTimeZone(getTimeZone()); return fmt; }
/** * Allows to serialize instances such that they are deserializable with the * previous implementation. * * @return the object to be serialized * @throws ObjectStreamException never */ private Object writeReplace() throws ObjectStreamException { MailDateFormat fmt = new MailDateFormat(); fmt.superApplyPattern("EEE, d MMM yyyy HH:mm:ss 'XXXXX' (z)"); fmt.setTimeZone(getTimeZone()); return fmt; }
/** * Allows to serialize instances such that they are deserializable with the * previous implementation. * * @return the object to be serialized * @throws ObjectStreamException never */ private Object writeReplace() throws ObjectStreamException { MailDateFormat fmt = new MailDateFormat(); fmt.superApplyPattern("EEE, d MMM yyyy HH:mm:ss 'XXXXX' (z)"); fmt.setTimeZone(getTimeZone()); return fmt; }
/** * Allows to serialize instances such that they are deserializable with the * previous implementation. * * @return the object to be serialized * @throws ObjectStreamException never */ private Object writeReplace() throws ObjectStreamException { MailDateFormat fmt = new MailDateFormat(); fmt.superApplyPattern("EEE, d MMM yyyy HH:mm:ss 'XXXXX' (z)"); fmt.setTimeZone(getTimeZone()); return fmt; }
/** * Allows to serialize instances such that they are deserializable with the * previous implementation. * * @return the object to be serialized * @throws ObjectStreamException never */ private Object writeReplace() throws ObjectStreamException { MailDateFormat fmt = new MailDateFormat(); fmt.superApplyPattern("EEE, d MMM yyyy HH:mm:ss 'XXXXX' (z)"); fmt.setTimeZone(getTimeZone()); return fmt; }
/** * Allows to serialize instances such that they are deserializable with the * previous implementation. * * @return the object to be serialized * @throws ObjectStreamException never */ private Object writeReplace() throws ObjectStreamException { MailDateFormat fmt = new MailDateFormat(); fmt.superApplyPattern("EEE, d MMM yyyy HH:mm:ss 'XXXXX' (z)"); fmt.setTimeZone(getTimeZone()); return fmt; }
/** * Removes all headers that are not on the whitelist, and initializes some * basic header fields.<br/> * Called by {@link #saveChanges()}, see JavaMail JavaDoc. * @throws MessagingException */ @Override public void updateHeaders() throws MessagingException { super.updateHeaders(); scrubHeaders(); removeRecipientNames(); // Depending on includeSendTime, set the send time or remove the send time field if (includeSendTime) { // Ensure the "Date" field is set in UTC time, using the English locale. MailDateFormat formatter = new MailDateFormat(); formatter.setTimeZone(TimeZone.getTimeZone("GMT")); // always use UTC for outgoing mail if (getSentDate() == null) setHeader("Date", formatter.format(new Date())); else setHeader("Date", formatter.format(getSentDate())); } else removeHeader("Date"); }
try { MailDateFormat dateFormat = new MailDateFormat(); dateFormat.setTimeZone(TimeZone.getTimeZone("Australia/Sydney")); status.setReceivedDate(dateFormat.parse(receivedDate)); } catch (ParseException e) {