...
Many of the Java SE APIs perform security manager checks by default before performing sensitive operations. For example, the constructor of class java.io.FileInputStream
throws a SecurityException
if the caller does not have the permission to read a file. Because SecurityException
is a subclass of RuntimeException
, the declarations of some API methods (for example, those of the java.io.FileReader
class) may lack a throws
clause that lists the SecurityException
. Avoid depending on the presence or absence of security manager checks that are not specified in the API method's documentation.
Class
...
Loader
The java.lang.ClassLoader
class and its descendent classes are the means by which new code is dynamically loaded into the JVM. Every class provides a link to the ClassLoader
that loaded it; furthermore every class loader class also has its own class that loaded it, on down to a single 'root' class loader. ClassLoader
itself is abstract, so it cannot be instantiated. All class loaders inherit from SecureClassLoader
, which itself inherits from ClassLoader
. SecureClassLoader
performs security checks on its members, as do its descendents. It defines a getPermissions()
method, which indicates the privileges available to classes loaded by the class loader, This serves to provide protection mechanisms limiting what additional classes may be loaded by untrusted code.
...