grant {
permission java.io.FilePermission "C:\\class\\*", "read, write";
permission java.lang.RuntimePermission "createClassLoader";
};
My policy.txt
java.security.AccessControlException: access denied (java.io.FilePermission c:\class read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at java.io.File.isDirectory(Unknown Source)
at java.io.File.toURI(Unknown Source)
at loader.Main.main(Main.java:35)
My exception..???
My call
String path = "c:\\class\\";
String app = "x.MyHTMLPrint";
File file = new File(path);
URL url = file.toURI().toURL();
URL[] urls = new URL[]{url};
ClassLoader cl = new URLClassLoader(urls);
Class cls = cl.loadClass(app);
As soon as I give it full Permission it works.
any ideas? thx!