Reputation: 21
I am using Java language What I want is that Can any one help me to write a code that When i click on delete option of any file or folder I get notify before delete that I ma deleting a file Whether I want to continue ? I have seen many examples that notify after the file is deleted. One thing I want to make clear is as I click on file placed Desktop or My document directory I must get notify that
You are deleting a file .do you want to continue ?
What I really need is I want the exact answer or code Please help I shall be very thankful to you
Upvotes: 0
Views: 234
Reputation: 24040
No, this is not possible in Java. The operating system handles the file access, and another process is not capable of preventing the system denying access to those files. The only way you could do this is by having a file system written in Java (say, a loopback mounted WebDAV share) to which you could intercept the file requests with this kind of information. But not only would this be difficult to achieve, it also would only work if all of the access you are doing is via your loopback mounted system; it wouldn't work for files located on the disk or from other network shares.
So, in summary, you cannot do this with any programming language without writing your own filesystem and using that to intercept requests.
Upvotes: 5