| java.lang.Object | |
| ↳ | com.google.code.com.sun.mail.imap.Rights |
The Rights class represents the set of rights for an authentication identifier (for instance, a user or a group).
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);
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Rights.Right | This inner class represents an individual right. | ||||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| rights | |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Construct an empty Rights object.
| |||||||||||
Construct a Rights object initialized with the given rights.
| |||||||||||
Construct a Rights object initialized with the given rights.
| |||||||||||
Construct a Rights object initialized with the given right.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Add all the rights in the given Rights object to this
Rights object.
| |||||||||||
Add the specified right to this Rights object.
| |||||||||||
Returns a clone of this Rights object.
| |||||||||||
Check whether all the rights in the specified Rights object are
present in this Rights object.
| |||||||||||
Check whether the specified right is present in this Rights object.
| |||||||||||
Check whether the two Rights objects are equal.
| |||||||||||
Return all the rights in this Rights object.
| |||||||||||
Compute a hash code for this Rights object.
| |||||||||||
Remove the specified right from this Rights object.
| |||||||||||
Remove all rights in the given Rights object from this
Rights object.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Construct an empty Rights object.
Construct a Rights object initialized with the given rights.
| rights | The rights for initialization |
|---|
Construct a Rights object initialized with the given rights.
| rights | The rights for initialization |
|---|
Construct a Rights object initialized with the given right.
| right | The right for initialization |
|---|
Add all the rights in the given Rights object to this Rights object.
| rights | Rights object |
|---|
Add the specified right to this Rights object.
| right | The right to add |
|---|
Returns a clone of this Rights object.
Check whether all the rights in the specified Rights object are present in this Rights object.
| rights |
|---|
Check whether the specified right is present in this Rights object.
| right |
|---|
Check whether the two Rights objects are equal.
| obj |
|---|
Return all the rights in this Rights object. Returns an array of size zero if no rights are set.
Compute a hash code for this Rights object.
Remove the specified right from this Rights object.
| right | The right to be removed |
|---|
Remove all rights in the given Rights object from this Rights object.
| rights | The rights to be removed |
|---|