如何防止ShellFolder.getFolderColumns(...)崩溃了很多 [英] How to prevent ShellFolder.getFolderColumns(...) from crashing a lot

查看:178
本文介绍了如何防止ShellFolder.getFolderColumns(...)崩溃了很多的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Java中使用隐藏的ShellFolder类。它有一个很好的方法叫getFolderColumns,它可以让你访问一些关于该文件的好数据。

b
$ b


线程中的异常
pool-1-thread-2445
java.lang.InternalError:无法
绑定C:\ Windows \ System32\zonedon.reg

的父项sun.awt.shell.Win32ShellFolder2 $ 4.call(Win32ShellFolder2.java:400)
at
sun.awt.shell.Win32ShellFolder2 $ 4.call(Win32ShellFolder2.java:385)
at
sun.awt.shell.Win32ShellFolderManager2 $ ComInvoker.invoke(Win32ShellFolderManager2.java:523)
at
sun.awt.shell.ShellFolder.invoke(ShellFolder.java:399)
at
sun.awt.shell.ShellFolder.invoke(ShellFolder.java:385)
at
sun.awt.shell.Win32ShellFolder2.getIShellFolder(Win32ShellFolder2.java:384)
at
sun.awt.shell.Win32ShellFolder2 $ 17.call(Win32ShellFolder2.java:1068)
at
sun.awt.she Win32ShellFolder2 $ 17.call(Win32ShellFolder2.java:1066)
at
java.util.concurrent.FutureTask $ Sync.innerRun(FutureTask.java:303)
at
java .util.concurrent.FutureTask.run(FutureTask.java:138)
at
java.util.concurrent.ThreadPoolExecutor $ Worker.runTask(ThreadPoolExecutor.java:886)
at
$ java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:908)
at
sun.awt.shell.Win32ShellFolderManager2 $ ComInvoker $ 3.run(Win32ShellFolderManager2.java:492)

java.lang.Thread.run(Thread.java:619)

你也无法理解这个并继续,因为它抛出一个UncaughtException。
我注意到,JFileChooser也使用这种方法,但是我似乎无法从这些类型的崩溃中找到它的预防/保护。

解决方案 div>

getFolderColumns方法仅适用于文件夹。所以缓存列信息(所以你知道列的位置),你仍然可以从文件中获取所需的列数据。我还没有看到文件夹中的列与文件不同的情况。



哦,只是要注意,这个方法只适用于windows。


I'm using the secret hidden ShellFolder class in Java. It has a nice method called getFolderColumns which gives you access to some nice data about the file.

Problem is that a lot of files crash it with :

Exception in thread "pool-1-thread-2445" java.lang.InternalError: Unable to bind C:\Windows\System32\zonedon.reg to parent at sun.awt.shell.Win32ShellFolder2$4.call(Win32ShellFolder2.java:400) at sun.awt.shell.Win32ShellFolder2$4.call(Win32ShellFolder2.java:385) at sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Win32ShellFolderManager2.java:523) at sun.awt.shell.ShellFolder.invoke(ShellFolder.java:399) at sun.awt.shell.ShellFolder.invoke(ShellFolder.java:385) at sun.awt.shell.Win32ShellFolder2.getIShellFolder(Win32ShellFolder2.java:384) at sun.awt.shell.Win32ShellFolder2$17.call(Win32ShellFolder2.java:1068) at sun.awt.shell.Win32ShellFolder2$17.call(Win32ShellFolder2.java:1066) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at sun.awt.shell.Win32ShellFolderManager2$ComInvoker$3.run(Win32ShellFolderManager2.java:492) at java.lang.Thread.run(Thread.java:619)

You also can't catch this and resume as it throws a UncaughtException. I noticed that JFileChooser also uses this method but I can't seem to find its prevention/protection from these type of crashes.

解决方案

getFolderColumns method only works for folders. So cache the column info(so you know the column position) and you can still get the column data needed from files. I haven't seen a case where the columns on folders are different from files.

Oh just to note that that this method is only good on windows.

这篇关于如何防止ShellFolder.getFolderColumns(...)崩溃了很多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆