james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [05/15] james-project git commit: PROTOCOLS-117 Bonus: Slightly simplify UserMailboxes webadmin routes
Date Fri, 03 Nov 2017 12:27:28 GMT
PROTOCOLS-117 Bonus: Slightly simplify UserMailboxes webadmin routes


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/0824d8f9
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/0824d8f9
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/0824d8f9

Branch: refs/heads/master
Commit: 0824d8f9dd7a5aee50e451a9300bbdc5e122789a
Parents: 28b75a0
Author: benwa <btellier@linagora.com>
Authored: Wed Nov 1 09:03:06 2017 +0700
Committer: benwa <btellier@linagora.com>
Committed: Fri Nov 3 15:48:40 2017 +0700

----------------------------------------------------------------------
 .../james/webadmin/service/UserMailboxesService.java    | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/0824d8f9/server/protocols/webadmin/webadmin-mailbox/src/main/java/org/apache/james/webadmin/service/UserMailboxesService.java
----------------------------------------------------------------------
diff --git a/server/protocols/webadmin/webadmin-mailbox/src/main/java/org/apache/james/webadmin/service/UserMailboxesService.java
b/server/protocols/webadmin/webadmin-mailbox/src/main/java/org/apache/james/webadmin/service/UserMailboxesService.java
index af0b658..581d1e9 100644
--- a/server/protocols/webadmin/webadmin-mailbox/src/main/java/org/apache/james/webadmin/service/UserMailboxesService.java
+++ b/server/protocols/webadmin/webadmin-mailbox/src/main/java/org/apache/james/webadmin/service/UserMailboxesService.java
@@ -103,8 +103,7 @@ public class UserMailboxesService {
     }
 
     private Stream<MailboxPath> listChildren(MailboxPath mailboxPath, MailboxSession
mailboxSession) throws MailboxException {
-        return mailboxManager.search(createUserMailboxesQuery(mailboxSession), mailboxSession)
-            .stream()
+        return listUserMailboxes(mailboxSession)
             .map(MailboxMetaData::getPath)
             .filter(path -> path.getHierarchyLevels(mailboxSession.getPathDelimiter()).contains(mailboxPath));
     }
@@ -127,13 +126,10 @@ public class UserMailboxesService {
     }
 
     private Stream<MailboxMetaData> listUserMailboxes(MailboxSession mailboxSession)
throws MailboxException {
-        return mailboxManager.search(createUserMailboxesQuery(mailboxSession), mailboxSession)
+        return mailboxManager.search(
+            MailboxQuery.privateMailboxesBuilder(mailboxSession).build(),
+            mailboxSession)
             .stream();
     }
 
-    private MailboxQuery createUserMailboxesQuery(MailboxSession mailboxSession) {
-        return MailboxQuery.privateMailboxesBuilder(mailboxSession)
-            .build();
-    }
-
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message