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 <btell...@linagora.com> Authored: Wed Sep 27 16:31:01 2017 +0700 Committer: Matthieu Baechler <matth...@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-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org