Java 类javax.mail.search.MessageIDTerm 实例源码

项目:camunda-bpm-mail    文件:DeleteMailConnector.java   
protected Message[] getMessagesByIds(Folder folder, List<String> messageIds) throws MessagingException {

    List<MessageIDTerm> idTerms = messageIds.stream()
        .map(MessageIDTerm::new)
        .collect(Collectors.toList());

    OrTerm searchTerm = new OrTerm(idTerms.toArray(new MessageIDTerm[idTerms.size()]));

    return folder.search(searchTerm);
  }