我在网络驱动器上有一个文件,在我们的环境中经常被许多人使用。如何使用Java跟踪文件打开/运行的次数。我对文件观察者http://docs.oracle.com/javase/tutorial/essential/io/notification.html进行了一些研究,但这些似乎只适用于创建,删除,修改和溢出。在我看一个正在观察切线的文件之前,这是可能的,最好的方法是什么?
答案 0 :(得分:0)
我真诚地希望你现在已经找到了解决方案。
但假设有问题的文件是某种可执行文件,您可以修改此问题的示例:How to get a list of current open windows/process with Java?。并使用JNA:
Timer
并使用if let userImageFile = profilePictures["profilePhoto"] as! PFFile {
//error is on the above line
userImageFile.getDataInBackgroundWithBlock({
(imageData: NSData?, error) -> Void in
var image = UIImage(data: imageData!)
self.profileImage.image = image
})
}
对象轮询系统。