You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
618 B
32 lines
618 B
package com.olexyn.burnsmail.flow.search;
|
|
|
|
import com.olexyn.burnsmail.MiscU;
|
|
|
|
import javax.mail.Folder;
|
|
import javax.mail.Message;
|
|
import javax.mail.Store;
|
|
|
|
public class FetchAll implements SearchFolder {
|
|
|
|
|
|
private final String src;
|
|
private Folder srcF;
|
|
|
|
public FetchAll(String src) {
|
|
this.src = src;
|
|
}
|
|
|
|
@Override
|
|
public Message[] search(Store store) {
|
|
try {
|
|
if (srcF == null) {
|
|
srcF = MiscU.open(store, src);
|
|
}
|
|
return srcF.getMessages();
|
|
} catch (Exception e) {
|
|
return new Message[0];
|
|
}
|
|
|
|
}
|
|
}
|