lThe
SecurityManager class
(in java.lang) provides the necessary mechanism for creating a security policy
that defines tasks that an application can and cannot do:
class
MySecurityManager extends SecurityManager {
private
boolean checkDelete = true;
public void checkDelete(String file)
{
if (checkDelete) {
throw new SecurityException(not
allowed);
}
}
}