下面列出了java.security.acl.NotOwnerException#java.security.acl.LastOwnerException 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* Deletes an owner. If this is the last owner in the ACL, an exception is raised.
*<P>
* The caller principal must be an owner of the ACL in order to invoke this method.
*
* @param caller the principal invoking this method. It must be an owner
* of the ACL.
* @param owner the owner to be removed from the list of owners.
* @return true if successful, false if owner is already an owner.
* @exception NotOwnerException if the caller principal is not an owner
* of the ACL.
* @exception LastOwnerException if there is only one owner left, so that
* deleteOwner would leave the ACL owner-less.
*/
public boolean deleteOwner(Principal caller, Principal owner)
throws NotOwnerException,LastOwnerException {
if (!ownerList.contains(caller))
throw new NotOwnerException();
if (!ownerList.contains(owner)){
return false;
} else {
if (ownerList.size() == 1)
throw new LastOwnerException();
ownerList.removeElement(owner);
return true;
}
}
/**
* Deletes an owner. If this is the last owner in the ACL, an exception is raised.
*<P>
* The caller principal must be an owner of the ACL in order to invoke this method.
*
* @param caller the principal invoking this method. It must be an owner
* of the ACL.
* @param owner the owner to be removed from the list of owners.
* @return true if successful, false if owner is already an owner.
* @exception NotOwnerException if the caller principal is not an owner
* of the ACL.
* @exception LastOwnerException if there is only one owner left, so that
* deleteOwner would leave the ACL owner-less.
*/
public boolean deleteOwner(Principal caller, Principal owner)
throws NotOwnerException,LastOwnerException {
if (!ownerList.contains(caller))
throw new NotOwnerException();
if (!ownerList.contains(owner)){
return false;
} else {
if (ownerList.size() == 1)
throw new LastOwnerException();
ownerList.removeElement(owner);
return true;
}
}
/**
* Deletes an owner. If this is the last owner in the ACL, an exception is raised.
*<P>
* The caller principal must be an owner of the ACL in order to invoke this method.
*
* @param caller the principal invoking this method. It must be an owner
* of the ACL.
* @param owner the owner to be removed from the list of owners.
* @return true if successful, false if owner is already an owner.
* @exception NotOwnerException if the caller principal is not an owner
* of the ACL.
* @exception LastOwnerException if there is only one owner left, so that
* deleteOwner would leave the ACL owner-less.
*/
public boolean deleteOwner(Principal caller, Principal owner)
throws NotOwnerException,LastOwnerException {
if (!ownerList.contains(caller))
throw new NotOwnerException();
if (!ownerList.contains(owner)){
return false;
} else {
if (ownerList.size() == 1)
throw new LastOwnerException();
ownerList.removeElement(owner);
return true;
}
}
/**
* Deletes an owner. If this is the last owner in the ACL, an exception is raised.
*<P>
* The caller principal must be an owner of the ACL in order to invoke this method.
*
* @param caller the principal invoking this method. It must be an owner
* of the ACL.
* @param owner the owner to be removed from the list of owners.
* @return true if successful, false if owner is already an owner.
* @exception NotOwnerException if the caller principal is not an owner
* of the ACL.
* @exception LastOwnerException if there is only one owner left, so that
* deleteOwner would leave the ACL owner-less.
*/
public boolean deleteOwner(Principal caller, Principal owner)
throws NotOwnerException,LastOwnerException {
if (!ownerList.contains(caller))
throw new NotOwnerException();
if (!ownerList.contains(owner)){
return false;
} else {
if (ownerList.size() == 1)
throw new LastOwnerException();
ownerList.removeElement(owner);
return true;
}
}
/**
* Deletes an owner. If this is the last owner in the ACL, an exception is raised.
*<P>
* The caller principal must be an owner of the ACL in order to invoke this method.
*
* @param caller the principal invoking this method. It must be an owner
* of the ACL.
* @param owner the owner to be removed from the list of owners.
* @return true if successful, false if owner is already an owner.
* @exception NotOwnerException if the caller principal is not an owner
* of the ACL.
* @exception LastOwnerException if there is only one owner left, so that
* deleteOwner would leave the ACL owner-less.
*/
public boolean deleteOwner(Principal caller, Principal owner)
throws NotOwnerException,LastOwnerException {
if (!ownerList.contains(caller))
throw new NotOwnerException();
if (!ownerList.contains(owner)){
return false;
} else {
if (ownerList.size() == 1)
throw new LastOwnerException();
ownerList.removeElement(owner);
return true;
}
}
/**
* Deletes an owner. If this is the last owner in the ACL, an exception is raised.
*<P>
* The caller principal must be an owner of the ACL in order to invoke this method.
*
* @param caller the principal invoking this method. It must be an owner
* of the ACL.
* @param owner the owner to be removed from the list of owners.
* @return true if successful, false if owner is already an owner.
* @exception NotOwnerException if the caller principal is not an owner
* of the ACL.
* @exception LastOwnerException if there is only one owner left, so that
* deleteOwner would leave the ACL owner-less.
*/
public boolean deleteOwner(Principal caller, Principal owner)
throws NotOwnerException,LastOwnerException {
if (!ownerList.contains(caller))
throw new NotOwnerException();
if (!ownerList.contains(owner)){
return false;
} else {
if (ownerList.size() == 1)
throw new LastOwnerException();
ownerList.removeElement(owner);
return true;
}
}
/**
* Deletes an owner. If this is the last owner in the ACL, an exception is raised.
*<P>
* The caller principal must be an owner of the ACL in order to invoke this method.
*
* @param caller the principal invoking this method. It must be an owner
* of the ACL.
* @param owner the owner to be removed from the list of owners.
* @return true if successful, false if owner is already an owner.
* @exception NotOwnerException if the caller principal is not an owner
* of the ACL.
* @exception LastOwnerException if there is only one owner left, so that
* deleteOwner would leave the ACL owner-less.
*/
public boolean deleteOwner(Principal caller, Principal owner)
throws NotOwnerException,LastOwnerException {
if (!ownerList.contains(caller))
throw new NotOwnerException();
if (!ownerList.contains(owner)){
return false;
} else {
if (ownerList.size() == 1)
throw new LastOwnerException();
ownerList.removeElement(owner);
return true;
}
}
/**
* Deletes an owner. If this is the last owner in the ACL, an exception is raised.
*<P>
* The caller principal must be an owner of the ACL in order to invoke this method.
*
* @param caller the principal invoking this method. It must be an owner
* of the ACL.
* @param owner the owner to be removed from the list of owners.
* @return true if successful, false if owner is already an owner.
* @exception NotOwnerException if the caller principal is not an owner
* of the ACL.
* @exception LastOwnerException if there is only one owner left, so that
* deleteOwner would leave the ACL owner-less.
*/
public boolean deleteOwner(Principal caller, Principal owner)
throws NotOwnerException,LastOwnerException {
if (!ownerList.contains(caller))
throw new NotOwnerException();
if (!ownerList.contains(owner)){
return false;
} else {
if (ownerList.size() == 1)
throw new LastOwnerException();
ownerList.removeElement(owner);
return true;
}
}
/**
* Deletes an owner. If this is the last owner in the ACL, an exception is raised.
*<P>
* The caller principal must be an owner of the ACL in order to invoke this method.
*
* @param caller the principal invoking this method. It must be an owner
* of the ACL.
* @param owner the owner to be removed from the list of owners.
* @return true if successful, false if owner is already an owner.
* @exception NotOwnerException if the caller principal is not an owner
* of the ACL.
* @exception LastOwnerException if there is only one owner left, so that
* deleteOwner would leave the ACL owner-less.
*/
public boolean deleteOwner(Principal caller, Principal owner)
throws NotOwnerException,LastOwnerException {
if (!ownerList.contains(caller))
throw new NotOwnerException();
if (!ownerList.contains(owner)){
return false;
} else {
if (ownerList.size() == 1)
throw new LastOwnerException();
ownerList.removeElement(owner);
return true;
}
}
/**
* Deletes an owner. If this is the last owner in the ACL, an exception is raised.
*<P>
* The caller principal must be an owner of the ACL in order to invoke this method.
*
* @param caller the principal invoking this method. It must be an owner
* of the ACL.
* @param owner the owner to be removed from the list of owners.
* @return true if successful, false if owner is already an owner.
* @exception NotOwnerException if the caller principal is not an owner
* of the ACL.
* @exception LastOwnerException if there is only one owner left, so that
* deleteOwner would leave the ACL owner-less.
*/
public boolean deleteOwner(Principal caller, Principal owner)
throws NotOwnerException,LastOwnerException {
if (!ownerList.contains(caller))
throw new NotOwnerException();
if (!ownerList.contains(owner)){
return false;
} else {
if (ownerList.size() == 1)
throw new LastOwnerException();
ownerList.removeElement(owner);
return true;
}
}
/**
* Deletes an owner. If this is the last owner in the ACL, an exception is raised.
*<P>
* The caller principal must be an owner of the ACL in order to invoke this method.
*
* @param caller the principal invoking this method. It must be an owner
* of the ACL.
* @param owner the owner to be removed from the list of owners.
* @return true if successful, false if owner is already an owner.
* @exception NotOwnerException if the caller principal is not an owner
* of the ACL.
* @exception LastOwnerException if there is only one owner left, so that
* deleteOwner would leave the ACL owner-less.
*/
public boolean deleteOwner(Principal caller, Principal owner)
throws NotOwnerException,LastOwnerException {
if (!ownerList.contains(caller))
throw new NotOwnerException();
if (!ownerList.contains(owner)){
return false;
} else {
if (ownerList.size() == 1)
throw new LastOwnerException();
ownerList.removeElement(owner);
return true;
}
}
/**
* Deletes an owner. If this is the last owner in the ACL, an exception is raised.
*<P>
* The caller principal must be an owner of the ACL in order to invoke this method.
*
* @param caller the principal invoking this method. It must be an owner
* of the ACL.
* @param owner the owner to be removed from the list of owners.
* @return true if successful, false if owner is already an owner.
* @exception NotOwnerException if the caller principal is not an owner
* of the ACL.
* @exception LastOwnerException if there is only one owner left, so that
* deleteOwner would leave the ACL owner-less.
*/
public boolean deleteOwner(Principal caller, Principal owner)
throws NotOwnerException,LastOwnerException {
if (!ownerList.contains(caller))
throw new NotOwnerException();
if (!ownerList.contains(owner)){
return false;
} else {
if (ownerList.size() == 1)
throw new LastOwnerException();
ownerList.removeElement(owner);
return true;
}
}
/**
* Deletes an owner. If this is the last owner in the ACL, an exception is raised.
*<P>
* The caller principal must be an owner of the ACL in order to invoke this method.
*
* @param caller the principal invoking this method. It must be an owner
* of the ACL.
* @param owner the owner to be removed from the list of owners.
* @return true if successful, false if owner is already an owner.
* @exception NotOwnerException if the caller principal is not an owner
* of the ACL.
* @exception LastOwnerException if there is only one owner left, so that
* deleteOwner would leave the ACL owner-less.
*/
public boolean deleteOwner(Principal caller, Principal owner)
throws NotOwnerException,LastOwnerException {
if (!ownerList.contains(caller))
throw new NotOwnerException();
if (!ownerList.contains(owner)){
return false;
} else {
if (ownerList.size() == 1)
throw new LastOwnerException();
ownerList.removeElement(owner);
return true;
}
}
/**
* Deletes an owner. If this is the last owner in the ACL, an exception is raised.
*<P>
* The caller principal must be an owner of the ACL in order to invoke this method.
*
* @param caller the principal invoking this method. It must be an owner
* of the ACL.
* @param owner the owner to be removed from the list of owners.
* @return true if successful, false if owner is already an owner.
* @exception NotOwnerException if the caller principal is not an owner
* of the ACL.
* @exception LastOwnerException if there is only one owner left, so that
* deleteOwner would leave the ACL owner-less.
*/
public boolean deleteOwner(Principal caller, Principal owner)
throws NotOwnerException,LastOwnerException {
if (!ownerList.contains(caller))
throw new NotOwnerException();
if (!ownerList.contains(owner)){
return false;
} else {
if (ownerList.size() == 1)
throw new LastOwnerException();
ownerList.removeElement(owner);
return true;
}
}