Windows上的Java:如何删除文件到垃圾箱(使用JNA) [英] Java on Windows: how to delete a file to trash (using JNA)
本文介绍了Windows上的Java:如何删除文件到垃圾箱(使用JNA)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我根本没有使用Windows API的经验,所以请原谅我的无知。
I'm not experiences with Windows API at all, so please excuse my ignorance.
我想将文件删除到垃圾箱。如何使用 JNA 以及如何检测这是否可行,例如,因为文件是否位于网络共享上?
I want to delete files to the trash. How to do that using JNA and how to detect if this would not be possible, e.g., because the files are located on a network share?
推荐答案
使用 com.sun.jna.platform.win32.W32FileUtils
,已定义 moveToTrash
和 hasTrash
方法。
这篇关于Windows上的Java:如何删除文件到垃圾箱(使用JNA)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文