Is there a platform-independent way with Java to detect the type of drive a file is located on? Basically I'm interested to distinguish between: hard disks, removable drives (like USB sticks) and network shares. JNI/JNA solutions won't be helpful. Java 7 can be assumed.
You could execute cmd using Java with:
fsutil fsinfo drivetype {drive letter}
The result will give you something like this:
C: - Fixed Drive
D: - CD-ROM Drive
E: - Removable Drive
P: - Remote/Network Drive