Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Win 7 上的 Eclipse [Helios] 中有没有办法监视要打开的文件?我是否必须知道应用程序将在哪里这样做,或者有没有办法监视正在创建的 java.io 对象/其他东西?
蒂亚雷内
FileInputStream您可以尝试在构造函数和/或条件的构造函数上设置断点,FileOutputStream以检查提供的文件名是否与您的目标文件名匹配(例如,检查采用文件名的构造函数上的参数,检查采用 a 的构造函数上的参数File.getName())File。或者或另外,您可以在File构造函数上设置断点,以检查指定的文件名是否是您的目标文件名。
FileInputStream
FileOutputStream
File.getName()
File
如果您的断点陷阱发生故障,您可以按照堆栈跟踪查看哪些方法直接或间接访问该文件。