/** * Construct an ACL entry for the given identifier and with no rights. * * @param name the identifier name */ public ACL(String name) { this.name = name; this.rights = new Rights(); }
/** * Construct a Rights object initialized with the given rights. * * @param rights the rights for initialization */ public Rights(String rights) { for (int i = 0; i < rights.length(); i++) add(Right.getInstance(rights.charAt(i))); }
/** * Clone this ACL entry. */ public Object clone() throws CloneNotSupportedException { ACL acl = (ACL)super.clone(); acl.rights = (Rights)this.rights.clone(); return acl; } }
/** * SETACL Command. * * @param mbox the mailbox * @param modifier the ACL modifier * @param acl the ACL * @exception ProtocolException for protocol failures * @see "RFC2086" */ public void setACL(String mbox, char modifier, ACL acl) throws ProtocolException { if (!hasCapability("ACL")) throw new BadCommandException("ACL not supported"); Argument args = new Argument(); writeMailboxName(args, mbox); args.writeString(acl.getName()); String rights = acl.getRights().toString(); if (modifier == '+' || modifier == '-') rights = modifier + rights; args.writeString(rights); Response[] r = command("SETACL", args); Response response = r[r.length-1]; // dispatch untagged responses notifyResponseHandlers(r); handleResult(response); }
/** * SETACL Command. * * @param mbox the mailbox * @param modifier the ACL modifier * @param acl the ACL * @exception ProtocolException for protocol failures * @see "RFC2086" */ public void setACL(String mbox, char modifier, ACL acl) throws ProtocolException { if (!hasCapability("ACL")) throw new BadCommandException("ACL not supported"); // encode the mbox as per RFC2060 mbox = BASE64MailboxEncoder.encode(mbox); Argument args = new Argument(); args.writeString(mbox); args.writeString(acl.getName()); String rights = acl.getRights().toString(); if (modifier == '+' || modifier == '-') rights = modifier + rights; args.writeString(rights); Response[] r = command("SETACL", args); Response response = r[r.length-1]; // dispatch untagged responses notifyResponseHandlers(r); handleResult(response); }
/** * Construct an ACL entry for the given identifier and with no rights. * * @param name the identifier name */ public ACL(String name) { this.name = name; this.rights = new Rights(); }
/** * Clone this ACL entry. */ @Override public Object clone() throws CloneNotSupportedException { ACL acl = (ACL)super.clone(); acl.rights = (Rights)this.rights.clone(); return acl; } }
/** * Construct a Rights object initialized with the given rights. * * @param rights the rights for initialization */ public Rights(String rights) { for (int i = 0; i < rights.length(); i++) add(Right.getInstance(rights.charAt(i))); }
/** * SETACL Command. * * @param mbox the mailbox * @param modifier the ACL modifier * @param acl the ACL * @exception ProtocolException for protocol failures * @see "RFC2086" */ public void setACL(String mbox, char modifier, ACL acl) throws ProtocolException { if (!hasCapability("ACL")) throw new BadCommandException("ACL not supported"); Argument args = new Argument(); writeMailboxName(args, mbox); args.writeString(acl.getName()); String rights = acl.getRights().toString(); if (modifier == '+' || modifier == '-') rights = modifier + rights; args.writeString(rights); Response[] r = command("SETACL", args); Response response = r[r.length-1]; // dispatch untagged responses notifyResponseHandlers(r); handleResult(response); }
if (rights == null) break; ACL acl = new ACL(name, new Rights(rights)); v.add(acl);
/** * Clone this ACL entry. */ public Object clone() throws CloneNotSupportedException { ACL acl = (ACL)super.clone(); acl.rights = (Rights)this.rights.clone(); return acl; } }
/** * Construct a Rights object initialized with the given rights. * * @param rights the rights for initialization */ public Rights(String rights) { for (int i = 0; i < rights.length(); i++) add(Right.getInstance(rights.charAt(i))); }
/** * SETACL Command. * * @param mbox the mailbox * @param modifier the ACL modifier * @param acl the ACL * @exception ProtocolException for protocol failures * @see "RFC2086" */ public void setACL(String mbox, char modifier, ACL acl) throws ProtocolException { if (!hasCapability("ACL")) throw new BadCommandException("ACL not supported"); Argument args = new Argument(); writeMailboxName(args, mbox); args.writeString(acl.getName()); String rights = acl.getRights().toString(); if (modifier == '+' || modifier == '-') rights = modifier + rights; args.writeString(rights); Response[] r = command("SETACL", args); Response response = r[r.length-1]; // dispatch untagged responses notifyResponseHandlers(r); handleResult(response); }
if (rights == null) break; ACL acl = new ACL(name, new Rights(rights)); v.add(acl);
/** * Clone this ACL entry. */ public Object clone() throws CloneNotSupportedException { ACL acl = (ACL)super.clone(); acl.rights = (Rights)this.rights.clone(); return acl; } }
/** * Construct a Rights object initialized with the given rights. * * @param rights the rights for initialization */ public Rights(String rights) { for (int i = 0; i < rights.length(); i++) add(Right.getInstance(rights.charAt(i))); }
/** * SETACL Command. * * @param mbox the mailbox * @param modifier the ACL modifier * @param acl the ACL * @exception ProtocolException for protocol failures * @see "RFC2086" */ public void setACL(String mbox, char modifier, ACL acl) throws ProtocolException { if (!hasCapability("ACL")) throw new BadCommandException("ACL not supported"); Argument args = new Argument(); writeMailboxName(args, mbox); args.writeString(acl.getName()); String rights = acl.getRights().toString(); if (modifier == '+' || modifier == '-') rights = modifier + rights; args.writeString(rights); Response[] r = command("SETACL", args); Response response = r[r.length-1]; // dispatch untagged responses notifyResponseHandlers(r); handleResult(response); }
String rights; while ((rights = ir.readAtomString()) != null) v.add(new Rights(rights)); r[i] = null;
/** * Clone this ACL entry. */ @Override public Object clone() throws CloneNotSupportedException { ACL acl = (ACL)super.clone(); acl.rights = (Rights)this.rights.clone(); return acl; } }
/** * Construct a Rights object initialized with the given rights. * * @param rights the rights for initialization */ public Rights(String rights) { for (int i = 0; i < rights.length(); i++) add(Right.getInstance(rights.charAt(i))); }