break; case MailInputField.COLUMN_RECEIVED_DATE: Date receivedDate = message.getReceivedDate(); r[index] = receivedDate != null ? new Date( receivedDate.getTime() ) : null; break;
when( message.getAllRecipients() ).thenReturn( adrRecip ); when( message.getDescription() ).thenReturn( DESC ); when( message.getReceivedDate() ).thenReturn( DATE1 ); when( message.getSentDate() ).thenReturn( DATE2 ); when( message.getContentType() ).thenReturn( CNTNT_TYPE_EMAIL );
/** * The match method. * * @param msg the date comparator is applied to this Message's * received date * @return true if the comparison succeeds, otherwise false */ public boolean match(Message msg) { Date d; try { d = msg.getReceivedDate(); } catch (Exception e) { return false; } if (d == null) return false; return d.getTime() >= System.currentTimeMillis() - ((long)interval * 1000); }
/** * The match method. * * @param msg the date comparator is applied to this Message's * received date * @return true if the comparison succeeds, otherwise false */ public boolean match(Message msg) { Date d; try { d = msg.getReceivedDate(); } catch (Exception e) { return false; } if (d == null) return false; return d.getTime() <= System.currentTimeMillis() - ((long)interval * 1000); }
/** * The match method. * * @param msg the date comparator is applied to this Message's * received date * @return true if the comparison succeeds, otherwise false */ @Override public boolean match(Message msg) { Date d; try { d = msg.getReceivedDate(); } catch (Exception e) { return false; } if (d == null) return false; return d.getTime() >= System.currentTimeMillis() - ((long)interval * 1000); }
/** * The match method. * * @param msg the date comparator is applied to this Message's * received date * @return true if the comparison succeeds, otherwise false */ @Override public boolean match(Message msg) { Date d; try { d = msg.getReceivedDate(); } catch (Exception e) { return false; } if (d == null) return false; return d.getTime() <= System.currentTimeMillis() - ((long)interval * 1000); }
/** * The match method. * * @param msg the date comparator is applied to this Message's * received date * @return true if the comparison succeeds, otherwise false */ public boolean match(Message msg) { Date d; try { d = msg.getReceivedDate(); } catch (Exception e) { return false; } if (d == null) return false; return super.match(d); }
/** * The match method. * * @param msg the date comparator is applied to this Message's * received date * @return true if the comparison succeeds, otherwise false */ @Override public boolean match(Message msg) { Date d; try { d = msg.getReceivedDate(); } catch (Exception e) { return false; } if (d == null) return false; return super.match(d); }
receivedDate(msg.getReceivedDate()); sentDate(msg.getSentDate());
logDebug( BaseMessages.getString( PKG, "JobGetMailsFromPOP.MessageNumber.Label", "" + messagenumber ) ); if ( mailConn.getMessage().getReceivedDate() != null ) { logDebug( BaseMessages.getString( PKG, "JobGetMailsFromPOP.ReceivedDate.Label", df .format( mailConn.getMessage().getReceivedDate() ) ) );
ArrayUtils.sort(messages, new Comparator<Message>() { @Override public int compareTo(Message m1, Message m2) { return m2.getReceivedDate().compareTo(m1.getReceivedDate()); } });
Date d = m.getReceivedDate(); // retain dates if (d == null) d = m.getSentDate();
Date d = m.getReceivedDate(); // retain dates if (d == null) d = m.getSentDate();
Date d = m.getReceivedDate(); // retain dates if (d == null) d = m.getSentDate();
Date d = m.getReceivedDate(); // retain dates if (d == null) d = m.getSentDate();
@Override public boolean match(Message msg) { try { return !msg.getReceivedDate().before(Date.from(firstTime.atZone(ZoneId.systemDefault()).toInstant())); } catch (MessagingException e) { return false; } } }));
@Override public Date getReceivedDate() throws RuntimeMessagingException { try { return delegate.getReceivedDate(); } catch (MessagingException e) { throw new RuntimeMessagingException(e); } }
public boolean match(Message message) { try { Date date = message.getReceivedDate(); if (date == null) { return false; } return match(date); } catch (MessagingException e) { return false; } }
private String generateUniqueId(Message msg) throws MessagingException { String sentDate = "NOSD"; String receivedDate = "NORD"; if (msg.getSentDate() != null) { sentDate = String.valueOf(msg.getSentDate().toInstant().toEpochMilli()); } if (msg.getReceivedDate() != null) { receivedDate = String.valueOf(msg.getReceivedDate().toInstant().toEpochMilli()); } String sender = getAddress(msg.getFrom()[0]); return joinStrings(msg.getSubject(), sender, sentDate, receivedDate); }
public static MailMessage fromMessage(final Message message) { try { ListMultimap<RecipientType, String> recipients = createRecipients(message); ListMultimap<String, String> headers = createHeaders(message); String text = MessageUtils.messageAsText(message, false); String from = message.getFrom()[0].toString(); return new MailMessage(message.getSentDate(), message.getReceivedDate(), from, recipients, message.getSubject(), text, headers); } catch (MessagingException ex) { throw new MailException("Error creating MailMessage.", ex); } }