|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcom.sun.mail.imap.Rights
public class 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);
| 嵌套类摘要 | |
|---|---|
static class |
Rights.Right
This inner class represents an individual right. |
| 构造方法摘要 | |
|---|---|
Rights()
Construct an empty Rights object. |
|
Rights(Rights.Right right)
Construct a Rights object initialized with the given right. |
|
Rights(Rights rights)
Construct a Rights object initialized with the given rights. |
|
Rights(String rights)
Construct a Rights object initialized with the given rights. |
|
| 方法摘要 | |
|---|---|
void |
add(Rights.Right right)
Add the specified right to this Rights object. |
void |
add(Rights rights)
Add all the rights in the given Rights object to this Rights object. |
Object |
clone()
Returns a clone of this Rights object. |
boolean |
contains(Rights.Right right)
Check whether the specified right is present in this Rights object. |
boolean |
contains(Rights rights)
Check whether all the rights in the specified Rights object are present in this Rights object. |
boolean |
equals(Object obj)
Check whether the two Rights objects are equal. |
Rights.Right[] |
getRights()
Return all the rights in this Rights object. |
int |
hashCode()
Compute a hash code for this Rights object. |
void |
remove(Rights.Right right)
Remove the specified right from this Rights object. |
void |
remove(Rights rights)
Remove all rights in the given Rights object from this Rights object. |
String |
toString()
|
| 从类 java.lang.Object 继承的方法 |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| 构造方法详细信息 |
|---|
public Rights()
public Rights(Rights rights)
rights - the rights for initializationpublic Rights(String rights)
rights - the rights for initializationpublic Rights(Rights.Right right)
right - the right for initialization| 方法详细信息 |
|---|
public void add(Rights.Right right)
right - the right to addpublic void add(Rights rights)
rights - Rights objectpublic void remove(Rights.Right right)
right - the right to be removedpublic void remove(Rights rights)
rights - the rights to be removedpublic boolean contains(Rights.Right right)
public boolean contains(Rights rights)
public boolean equals(Object obj)
Object 中的 equalspublic int hashCode()
Object 中的 hashCodepublic Rights.Right[] getRights()
public Object clone()
Object 中的 clonepublic String toString()
Object 中的 toString
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||