java.security.AccessControlException:在签名的applet中使用java web start访问被拒绝(java.io.FilePermission <file> read)</file>

时间:2013-02-07 09:08:24

标签: java io applet java-web-start securityexception

我有一个由java web start启动器启动的applet,它也已签名。 我需要使用此applet在客户端计算机上执行一些文件操作,这样做会引发异常。下面是完整的堆栈跟踪

java.security.AccessControlException: access denied (java.io.FilePermission C:\FMS\ELSV\JOURNAL\ARBRES\554 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 org.apache.commons.io.FileUtils.validateListFilesParameters(FileUtils.java:544)
at org.apache.commons.io.FileUtils.listFiles(FileUtils.java:521)
at com.newgen.customs.CNU.deleteSelectiveFiles(CNU.java:121)
at com.newgen.customs.CNU.filter(CNU.java:146)
at com.newgen.backend.Operation.call(Operation.java:83)
at filetransfermanager.FileTransferManagerView$1.windowOpened(FileTransferManagerView.java:48)
at java.awt.AWTEventMulticaster.windowOpened(Unknown Source)
at java.awt.Window.processWindowEvent(Unknown Source)
at javax.swing.JFrame.processWindowEvent(Unknown Source)
at java.awt.Window.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

以下是正在使用的导致问题的代码。 (但我不认为它的代码)

listSaveFile.addAll(Arrays.asList(saveFileArr));
System.out.println("" + listSaveFile);

Collection<File> found = FileUtils.listFiles(new File(sFolderPath),
                         new NotFileFilter(new NameFileFilter(listSaveFile, IOCase.INSENSITIVE)),
                                 TrueFileFilter.INSTANCE);

for (File f : found) {
   try {
           FileUtils.forceDelete(f);
       } catch (Exception e) {
            delFlag = false;
            System.out.println("" + e.getMessage());
       }
 }

请帮忙。提前致谢。

0 个答案:

没有答案