title: java security manager
body: <pre><code>grant {
       permission java.io.FilePermission "C:\\class\\*", "read, write";
       permission java.lang.RuntimePermission "createClassLoader";
  };
  </code></pre>
  
  <p>My policy.txt</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>My exception..???</p>
  
  <p>My call</p>
  
  <pre><code>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);
  </code></pre>
  
  <p>As soon as I give it full Permission it works.</p>
  
  <p>any ideas? thx!</p>