1

我有一个由 java web start 启动器启动的小程序,它也已签名。我需要用这个小程序在客户端机器上做一些文件操作,这样做会抛出异常。下面是完整的堆栈跟踪

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());
       }
 }

请帮忙。提前致谢。

4

0 回答 0