A right is represented by the Rights.Right
inner class.
A set of standard rights are predefined (see RFC 2086). Most folder implementations are expected to support these rights. Some implementations may also support site-defined rights.
The following code sample illustrates how to examine your rights for a folder.
Rights rights = folder.myRights();
// Check if I can write this folder
if (rights.contains(Rights.Right.WRITE))
System.out.println("Can write folder");
// Now give Joe all my rights, except the ability to write the folder
rights.remove(Rights.Right.WRITE);
ACL acl = new ACL("joe", rights);
folder.setACL(acl);
| Modifier and Type | Class and Description |
|---|---|
| public static class | Rights.Right
This inner class represents an individual right. |
| Modifier and Type | Field and Description |
|---|---|
| private boolean[] |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public Object | |
| public boolean | |
| public boolean | |
| public boolean | Returns: true if they're equalthe reference object with which to compare. obj)Overrides java. |
| public Rights. | Returns: array of Rights.Right objects representing rightsReturn all the rights in this Rights object. |
| public int | Returns: the hash codeOverrides java. |
| public void | |
| public void | |
| public String |
| rights | back to summary |
|---|---|
| private boolean[] rights | |
| Rights | back to summary |
|---|---|
| public Rights() Construct an empty Rights object. | |
| Rights | back to summary |
|---|---|
| public Rights(Rights rights) Construct a Rights object initialized with the given rights.
| |
| Rights | back to summary |
|---|---|
| public Rights(String rights) Construct a Rights object initialized with the given rights.
| |
| Rights | back to summary |
|---|---|
| public Rights(Rights. Construct a Rights object initialized with the given right. | |
| add | back to summary |
|---|---|
| public void add(Rights. Add the specified right to this Rights object. | |
| add | back to summary |
|---|---|
| public void add(Rights rights) Add all the rights in the given Rights object to this Rights object.
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Returns a clone of this Rights object.
| |
| contains | back to summary |
|---|---|
| public boolean contains(Rights. Check whether the specified right is present in this Rights object. | |
| contains | back to summary |
|---|---|
| public boolean contains(Rights rights) Check whether all the rights in the specified Rights object are present in this Rights object.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Check whether the two Rights objects are equal.
| |
| getRights | back to summary |
|---|---|
| public Rights. Return all the rights in this Rights object. Returns an array of size zero if no rights are set. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Compute a hash code for this Rights object.
| |
| remove | back to summary |
|---|---|
| public void remove(Rights. Remove the specified right from this Rights object. | |
| remove | back to summary |
|---|---|
| public void remove(Rights rights) Remove all rights in the given Rights object from this Rights object.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final Rights. | ADMINISTER
Administer - perform SETACL. |
| private static Rights. | |
| public static final Rights. | CREATE
Create - CREATE new sub-mailboxes in any implementation-defined hierarchy, RENAME or DELETE mailbox. |
| public static final Rights. | DELETE
Delete - STORE \DELETED flag, perform EXPUNGE. |
| public static final Rights. | INSERT
Insert - perform APPEND, COPY into mailbox. |
| public static final Rights. | KEEP_SEEN
Keep seen/unseen information across sessions - STORE \SEEN flag. |
| public static final Rights. | LOOKUP
Lookup - mailbox is visible to LIST/LSUB commands. |
| public static final Rights. | POST
Post - send mail to submission address for mailbox, not enforced by IMAP4 itself. |
| public static final Rights. | READ
Read - SELECT the mailbox, perform CHECK, FETCH, PARTIAL, SEARCH, COPY from mailbox |
| pack-priv char | |
| public static final Rights. | WRITE
Write - STORE flags other than \SEEN and \DELETED. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static synchronized Rights. | Returns: the Right objectthe character representing the right right)Get a Right object representing the specified character. |
| public String |
| ADMINISTER | back to summary |
|---|---|
| public static final Rights. Administer - perform SETACL. | |
| cache | back to summary |
|---|---|
| private static Rights. | |
| CREATE | back to summary |
|---|---|
| public static final Rights. Create - CREATE new sub-mailboxes in any implementation-defined hierarchy, RENAME or DELETE mailbox. | |
| DELETE | back to summary |
|---|---|
| public static final Rights. Delete - STORE \DELETED flag, perform EXPUNGE. | |
| INSERT | back to summary |
|---|---|
| public static final Rights. Insert - perform APPEND, COPY into mailbox. | |
| KEEP_SEEN | back to summary |
|---|---|
| public static final Rights. Keep seen/unseen information across sessions - STORE \SEEN flag. | |
| LOOKUP | back to summary |
|---|---|
| public static final Rights. Lookup - mailbox is visible to LIST/LSUB commands. | |
| POST | back to summary |
|---|---|
| public static final Rights. Post - send mail to submission address for mailbox, not enforced by IMAP4 itself. | |
| READ | back to summary |
|---|---|
| public static final Rights. Read - SELECT the mailbox, perform CHECK, FETCH, PARTIAL, SEARCH, COPY from mailbox | |
| right | back to summary |
|---|---|
| pack-priv char right | |
| WRITE | back to summary |
|---|---|
| public static final Rights. Write - STORE flags other than \SEEN and \DELETED. | |
| Right | back to summary |
|---|---|
| private Right(char right) Private constructor used only by getInstance. | |
| getInstance | back to summary |
|---|---|
| public static synchronized Rights. Get a Right object representing the specified character. Characters are assigned per RFC 2086. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |