From f5de98d1a4f1ca0684709e402f0f7028bb57211a Mon Sep 17 00:00:00 2001 From: "Aaron M. Renn" Date: Tue, 1 Sep 1998 02:33:10 +0000 Subject: Initial Checkin --- java/security/AccessControlException.java | 102 ++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 java/security/AccessControlException.java (limited to 'java/security/AccessControlException.java') diff --git a/java/security/AccessControlException.java b/java/security/AccessControlException.java new file mode 100644 index 000000000..471634547 --- /dev/null +++ b/java/security/AccessControlException.java @@ -0,0 +1,102 @@ +/************************************************************************* +/* AccessControlException.java -- Permission is denied +/* +/* Copyright (c) 1998 Free Software Foundation, Inc. +/* Written by Aaron M. Renn (arenn@urbanophile.com) +/* +/* This library is free software; you can redistribute it and/or modify +/* it under the terms of the GNU Library General Public License as published +/* by the Free Software Foundation, either version 2 of the License, or +/* (at your option) any later verion. +/* +/* This library is distributed in the hope that it will be useful, but +/* WITHOUT ANY WARRANTY; without even the implied warranty of +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +/* GNU Library General Public License for more details. +/* +/* You should have received a copy of the GNU Library General Public License +/* along with this library; if not, write to the Free Software Foundation +/* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA +/*************************************************************************/ + +package java.security; + +/** + * This exception is thrown when the AccessController denies + * an attempt to perform an operation. + * + * @version 0.0 + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ +public class AccessControlException extends SecurityException +{ + +/*************************************************************************/ + +/* + * Instance Variables + */ + +/** + * The Permission associated with this exception + */ +private Permission perm; + +/*************************************************************************/ + +/* + * Constructors + */ + +/** + * This method initializes a new instance of AccessControlException + * with a descriptive error message. There will be no Permission + * object associated with this exception. + * + * @param msg The descriptive error message + */ +public +AccessControlException(String msg) +{ + super(msg); +} + +/*************************************************************************/ + +/** + * This method initializes a new instance of AccessControlException + * with a descriptive error message and an instance of Permission + * that is the permission that caused the exception to be thrown. + * + * @param msg The descriptive error message + * @param perm The Permission object that caused this exception. + */ +public +AccessControlException(String msg, Permission perm) +{ + super(msg); + + this.perm = perm; +} + +/*************************************************************************/ + +/* + * Instance Methods + */ + +/** + * This method returns the Permission object that caused + * this exception to be thrown. + * + * @return The requested Permission object, or null if none is available. + */ +public Permission +getPermission() +{ + return(perm); +} + +} // class AccessControlException + -- cgit v1.2.1