Reputation: 9478
I need a file system that is platform independent and where i receive any changes made to the file system by the user in a java application.
Or is there an API where i get notified about changes and where i can prevent such changes?
For example when the user moves a file within that file system i want to be notified about it and to be able to prevent that movement.
Which platform independent file systems exist with these properties?
Upvotes: 0
Views: 289
Reputation: 719436
I don't there is such a thing as a platform independent file system. There are file systems that are implemented on multiple platforms, but that's not much help if the application needs to use different APIs to access them. depending on the platform/
There is such a thing as a platform independent file system API, and the java.nio.file
package contains the standard Java offerings.
For example, the WatchService
API allows you to get notifications for some changes to files in a nominated directory. However, it does NOT specifically detect "moves", and it certainly doesn't allow the Java application to veto an action. In fact, I'm pretty sure that this (veto) is not supported at the OS syscall level.
On Linux, I think that the only reasonable way you could implement a file system where one application could veto acctions made by another program would be to code a custom FUSE file system implementation.
Upvotes: 3
Reputation: 2191
FAT / FAT32 is platform independent.
But I never heard of a FS that notifies, when a user edits or moves a file. There are always applications watching those files and doing the notify stuff.
Upvotes: 1
Reputation: 2542
The Java NIO API can do this, and is already platform independent http://docs.oracle.com/javase/tutorial/essential/io/notification.html
Upvotes: 1