james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [6/6] james-project git commit: JAMES-2043 No mailbox exception was thrown in UserProvisioningFilter
Date Tue, 06 Jun 2017 08:28:55 GMT
JAMES-2043 No mailbox exception was thrown in UserProvisioningFilter


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

Branch: refs/heads/master
Commit: ffd836d54fb457ec9351c03b4224b2e4c68faa96
Parents: c05b38f
Author: benwa <btellier@linagora.com>
Authored: Fri Jun 2 12:02:01 2017 +0700
Committer: benwa <btellier@linagora.com>
Committed: Tue Jun 6 15:28:16 2017 +0700

----------------------------------------------------------------------
 .../apache/james/jmap/UserProvisioningFilter.java   | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/ffd836d5/server/protocols/jmap/src/main/java/org/apache/james/jmap/UserProvisioningFilter.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/UserProvisioningFilter.java
b/server/protocols/jmap/src/main/java/org/apache/james/jmap/UserProvisioningFilter.java
index 04bee42..6857479 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/UserProvisioningFilter.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/UserProvisioningFilter.java
@@ -33,8 +33,6 @@ import javax.servlet.ServletResponse;
 
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.MailboxSession.User;
-import org.apache.james.mailbox.exception.BadCredentialsException;
-import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.metrics.api.MetricFactory;
 import org.apache.james.metrics.api.TimeMetric;
 import org.apache.james.user.api.AlreadyExistInUsersRepositoryException;
@@ -79,13 +77,17 @@ public class UserProvisioningFilter implements Filter {
             }
         } catch (AlreadyExistInUsersRepositoryException e) {
             // Ignore
-        } catch (UsersRepositoryException|MailboxException e) {
+        } catch (UsersRepositoryException e) {
             throw Throwables.propagate(e);
         } finally {
             timeMetric.stopAndPublish();
         }
     }
 
+    private void createAccount(User user) throws UsersRepositoryException {
+        usersRepository.addUser(getUsername(user), generatePassword());
+    }
+
     private boolean needsAccountCreation(User user) throws UsersRepositoryException {
         return !usersRepository.contains(getUsername(user));
     }
@@ -97,14 +99,6 @@ public class UserProvisioningFilter implements Filter {
             return user.getUserName();
         }
     }
-
-    private void createAccount(User user) throws UsersRepositoryException, BadCredentialsException,
MailboxException {
-        createUser(user);
-    }
-
-    private void createUser(User user) throws UsersRepositoryException {
-        usersRepository.addUser(getUsername(user), generatePassword());
-    }
     
     private String generatePassword() {
         return UUID.randomUUID().toString();


---------------------------------------------------------------------
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