You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ma...@apache.org on 2017/09/29 07:21:45 UTC
[07/31] james-project git commit: MAILBOX-307 Drop compatibility modes
MAILBOX-307 Drop compatibility modes
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/54f5d8d2
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/54f5d8d2
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/54f5d8d2
Branch: refs/heads/master
Commit: 54f5d8d267911a6c905b96ad1c23665cd778b81e
Parents: 6494899
Author: benwa <bt...@linagora.com>
Authored: Wed Sep 27 16:31:01 2017 +0700
Committer: Matthieu Baechler <ma...@apache.org>
Committed: Fri Sep 29 09:20:40 2017 +0200
----------------------------------------------------------------------
.../apache/james/mailbox/model/MailboxACL.java | 42 +-------------------
1 file changed, 2 insertions(+), 40 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/james-project/blob/54f5d8d2/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxACL.java
----------------------------------------------------------------------
diff --git a/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxACL.java b/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxACL.java
index a7afa02..de7c8f2 100644
--- a/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxACL.java
+++ b/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxACL.java
@@ -166,21 +166,9 @@ public class MailboxACL {
* MailboxACLRights are initialized.
*/
public static class Rfc4314Rights {
- /**
- * See RFC 4314 section 2.1.1. Obsolete Rights.
- */
- public enum CompatibilityMode {
- ck_detx, ckx_det, NO_COMPATIBILITY
- }
-
private static final char c_ObsoleteCreate = 'c';
private static final char d_ObsoleteDelete = 'd';
- /**
- * See RFC 4314 section 2.1.1. Obsolete Rights.
- */
- private final CompatibilityMode compatibilityMode = CompatibilityMode.ckx_det;
-
private final EnumSet<Right> value;
private Rfc4314Rights(EnumSet<Right> rights) {
@@ -209,37 +197,11 @@ public class MailboxACL {
private Stream<Right> convert(char flag) throws UnsupportedRightException {
switch (flag) {
case c_ObsoleteCreate:
- return convertObsoleteCreate(flag);
+ return Stream.of(Right.CreateMailbox, Right.DeleteMailbox);
case d_ObsoleteDelete:
- return convertObsoleteDelete(flag);
- default:
- return Stream.of(Right.forChar(flag));
- }
- }
-
- private Stream<Right> convertObsoleteDelete(char flag) throws UnsupportedRightException {
- switch (compatibilityMode) {
- case ck_detx:
return Stream.of(Right.PerformExpunge, Right.DeleteMessages, Right.DeleteMailbox);
- case ckx_det:
- return Stream.of(Right.PerformExpunge, Right.DeleteMessages);
- case NO_COMPATIBILITY:
- throw new UnsupportedRightException(flag);
default:
- throw new IllegalStateException("Unexpected enum member: " + CompatibilityMode.class.getName() + "." + compatibilityMode.name());
- }
- }
-
- private Stream<Right> convertObsoleteCreate(char flag) throws UnsupportedRightException {
- switch (compatibilityMode) {
- case ck_detx:
- return Stream.of(Right.CreateMailbox);
- case ckx_det:
- return Stream.of(Right.CreateMailbox, Right.DeleteMailbox);
- case NO_COMPATIBILITY:
- throw new UnsupportedRightException(flag);
- default:
- throw new IllegalStateException("Unexpected enum member: " + CompatibilityMode.class.getName() + "." + compatibilityMode.name());
+ return Stream.of(Right.forChar(flag));
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org