List of usage examples for javax.mail.search SearchTerm match
public abstract boolean match(Message msg);
From source file:org.alfresco.repo.imap.AlfrescoImapFolder.java
@Override protected long[] searchInternal(SearchTerm searchTerm) { List<SimpleStoredMessage> messages = getMessages(); long[] result = new long[messages.size()]; int i = 0;/*from w w w .j a v a2s. com*/ for (SimpleStoredMessage message : messages) { if (searchTerm.match(message.getMimeMessage())) { result[i] = message.getUid(); i++; } } return Arrays.copyOfRange(result, 0, i); }