seekStrategy = new FlagTerm(new Flags(Flags.Flag.SEEN), false);
LOG.debug("Fetching all unread emails");
break;
}
try {
final GmailMessageList found = new GmailMessageList();
final Store store = openGmailStore();
final Folder folder = getFolder(this.srcFolder,store);
folder.open(Folder.READ_ONLY);
for (final Message msg : folder.search(seekStrategy)) {
found.add(new JavaMailGmailMessage(msg));
}
LOG.debug("Found " + found.size() + " emails");
return found;
} catch (final Exception e) {
throw new GmailException("Failed getting unread messages", e);
}
}