Methods Summary |
---|
public static void | dummyMethod()
|
public static java.security.Permission | getConnectPermission()
return connectPermission;
|
public static java.security.Permission | getMulticastPermission()
return multicastPermission;
|
public java.lang.String | getName()
return "jdk12";
|
public static java.security.Permission | getReadAllFilesPermission()
return readAllFilesPermission;
|
public static java.security.Permission | getReadFilePermission(java.lang.String name)
security = new JDK12Security();
try {
cls = security.getClass();
dummyMethodRef = cls.getMethod("dummyMethod",new Class[0]);
Class rtperm = Class.forName("java.lang.RuntimePermission");
Class socketperm = Class.forName("java.net.SocketPermission");
Class fileperm = Class.forName("java.io.FilePermission");
filepermcons = fileperm.getConstructor(new Class[] {String.class, String.class});
Constructor cons = rtperm.getConstructor(new Class[] {String.class});
threadPermission = (Permission) cons.newInstance(new Object[] {"modifyThread"});
// System.out.println("threadPermission is " + threadPermission);
threadGroupPermission = (Permission) cons.newInstance(new Object[] {"modifyThreadGroup"});
// System.out.println("threadGroupPermission is " + threadGroupPermission);
cons = socketperm.getConstructor(new
Class[] {
String.class, String.class
});
connectPermission = (Permission) cons.newInstance(
new Object[] {"*", "connect"});
// System.out.println("connectPermission is " + connectPermission);
multicastPermission = (Permission) cons.newInstance(
new Object[] {"*", "accept,connect"});
// System.out.println("multicastPermission is " + multicastPermission);
// I don't think there is a way of saying
// give permission to read a file called jmf.properties
// no matter what the path. Check
// readAllFilesPermission = (Permission) cons.newInstance(
// new Object[] {"ALL FILES", "read"});
// System.out.println("readAllFilesPermission is " + readAllFilesPermission);
} catch (Exception e) {
}
try {
return (Permission) filepermcons.newInstance(
new Object[] {name, "read"});
} catch (Exception e) {
return null;
}
|
public static java.security.Permission | getThreadGroupPermission()
return threadGroupPermission;
|
public static java.security.Permission | getThreadPermission()
return threadPermission;
|
public static java.security.Permission | getWriteFilePermission(java.lang.String name)
try {
return (Permission) filepermcons.newInstance(
new Object[] {name, "read, write"});
} catch (Exception e) {
return null;
}
|
public boolean | isLinkPermissionEnabled()
return true;
|
public void | loadLibrary(java.lang.String name)
AccessController.doPrivileged(
new java.security.PrivilegedAction() {
public Object run() {
System.loadLibrary(name);
return null;
}
}
);
|
public void | permissionFailureNotification(int permission)
|
public void | requestPermission(java.lang.reflect.Method[] m, java.lang.Class[] c, java.lang.Object[][] args, int request)
m[0] = dummyMethodRef;
c[0] = cls;
args[0] = null;
//throw new SecurityException("DefulatSecurity : Cannot request permission");
|
public void | requestPermission(java.lang.reflect.Method[] m, java.lang.Class[] c, java.lang.Object[][] args, int request, java.lang.String parameter)
requestPermission(m, c, args, request);
|