允许Class.getResource(“name”)需要什么java策略

时间:2013-10-08 05:05:23

标签: java security-policy

我试图调用以下内容:

http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#getResource(java.lang.String)

但是,当我打开以下java安全策略时,它会失败(返回null)。我找不到要改变的东西才能让它起作用?

grant {
  permission java.io.FilePermission "/tmp", "read";
  permission java.io.FilePermission "/tmp/directory.db", "read, write";
  permission java.util.PropertyPermission "data.folder", "read";
  permission java.util.PropertyPermission "user.dir", "read";
  permission java.lang.RuntimePermission "loadLibrary.*";
};

0 个答案:

没有答案