本文整理了Java中javax.mail.Message.getReceivedDate()
方法的一些代码示例,展示了Message.getReceivedDate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getReceivedDate()
方法的具体详情如下:
包路径:javax.mail.Message
类名称:Message
方法名:getReceivedDate
[英]Get the date this message was received.
[中]获取收到此邮件的日期。
代码示例来源:origin: pentaho/pentaho-kettle
break;
case MailInputField.COLUMN_RECEIVED_DATE:
Date receivedDate = message.getReceivedDate();
r[index] = receivedDate != null ? new Date( receivedDate.getTime() ) : null;
break;
代码示例来源:origin: pentaho/pentaho-kettle
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 );
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* 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);
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* 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);
}
代码示例来源:origin: com.sun.mail/javax.mail
/**
* 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);
}
代码示例来源:origin: com.sun.mail/javax.mail
/**
* 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);
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* 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);
}
代码示例来源:origin: com.sun.mail/javax.mail
/**
* 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);
}
代码示例来源:origin: oblac/jodd
receivedDate(msg.getReceivedDate());
sentDate(msg.getSentDate());
代码示例来源:origin: pentaho/pentaho-kettle
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() ) ) );
代码示例来源:origin: stackoverflow.com
ArrayUtils.sort(messages, new Comparator<Message>() {
@Override
public int compareTo(Message m1, Message m2) {
return m2.getReceivedDate().compareTo(m1.getReceivedDate());
}
});
代码示例来源:origin: camunda/camunda-bpm-platform
Date d = m.getReceivedDate(); // retain dates
if (d == null)
d = m.getSentDate();
代码示例来源:origin: com.sun.mail/javax.mail
Date d = m.getReceivedDate(); // retain dates
if (d == null)
d = m.getSentDate();
代码示例来源:origin: com.sun.mail/javax.mail
Date d = m.getReceivedDate(); // retain dates
if (d == null)
d = m.getSentDate();
代码示例来源:origin: camunda/camunda-bpm-platform
Date d = m.getReceivedDate(); // retain dates
if (d == null)
d = m.getSentDate();
代码示例来源:origin: com.infotel.seleniumRobot/core
@Override
public boolean match(Message msg) {
try {
return !msg.getReceivedDate().before(Date.from(firstTime.atZone(ZoneId.systemDefault()).toInstant()));
} catch (MessagingException e) {
return false;
}
}
}));
代码示例来源:origin: google/mail-importer
@Override
public Date getReceivedDate() throws RuntimeMessagingException {
try {
return delegate.getReceivedDate();
} catch (MessagingException e) {
throw new RuntimeMessagingException(e);
}
}
代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.4_spec
public boolean match(Message message) {
try {
Date date = message.getReceivedDate();
if (date == null) {
return false;
}
return match(date);
} catch (MessagingException e) {
return false;
}
}
代码示例来源:origin: dstl/baleen
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);
}
代码示例来源:origin: com.mgmtp.jfunk/jfunk-core
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);
}
}
内容来源于网络,如有侵权,请联系作者删除!