IMAP: Implement davmail.folderSizeLimit
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2177 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
bb70c7f092
commit
ad9ac4f0ad
|
@ -2057,7 +2057,8 @@ public class DavExchangeSession extends ExchangeSession {
|
||||||
@Override
|
@Override
|
||||||
public MessageList searchMessages(String folderPath, Set<String> attributes, Condition condition) throws IOException {
|
public MessageList searchMessages(String folderPath, Set<String> attributes, Condition condition) throws IOException {
|
||||||
MessageList messages = new MessageList();
|
MessageList messages = new MessageList();
|
||||||
MultiStatusResponse[] responses = searchItems(folderPath, attributes, and(isFalse("isfolder"), isFalse("ishidden"), condition), FolderQueryTraversal.Shallow, 0);
|
int maxCount = Settings.getIntProperty("davmail.folderSizeLimit", 0);
|
||||||
|
MultiStatusResponse[] responses = searchItems(folderPath, attributes, and(isFalse("isfolder"), isFalse("ishidden"), condition), FolderQueryTraversal.Shallow, maxCount);
|
||||||
|
|
||||||
for (MultiStatusResponse response : responses) {
|
for (MultiStatusResponse response : responses) {
|
||||||
Message message = buildMessage(response);
|
Message message = buildMessage(response);
|
||||||
|
|
|
@ -663,7 +663,8 @@ public class EwsExchangeSession extends ExchangeSession {
|
||||||
@Override
|
@Override
|
||||||
public MessageList searchMessages(String folderPath, Set<String> attributes, Condition condition) throws IOException {
|
public MessageList searchMessages(String folderPath, Set<String> attributes, Condition condition) throws IOException {
|
||||||
MessageList messages = new MessageList();
|
MessageList messages = new MessageList();
|
||||||
List<EWSMethod.Item> responses = searchItems(folderPath, attributes, condition, FolderQueryTraversal.SHALLOW, 0);
|
int maxCount = Settings.getIntProperty("davmail.folderSizeLimit", 0);
|
||||||
|
List<EWSMethod.Item> responses = searchItems(folderPath, attributes, condition, FolderQueryTraversal.SHALLOW, maxCount);
|
||||||
|
|
||||||
for (EWSMethod.Item response : responses) {
|
for (EWSMethod.Item response : responses) {
|
||||||
if (MESSAGE_TYPES.contains(response.type)) {
|
if (MESSAGE_TYPES.contains(response.type)) {
|
||||||
|
|
Loading…
Reference in New Issue