Java: access a folder shared with Windows on both Linux and Windows
In my Java project I want to store data in a folder shared between Windows and Linux called "Web" (or a subfolder of that folder). The folder resides on a shared NTFS data partition. The point is that I want to be able to run the application in both systems and work on the same data. I have the same editor on both systems (Netbeans) but I don't want to store the data in the project folder or working directory of the program.
In Windows the path to that folder is:
In Ubuntu it's mounted as
Those paths are different so when I run the code with the Windows path it obviously does not work. The Linux mount path would not make sense on Windows. Is it possible in Java to check which operating system is being used and define the proper root for the path?
"I believe humans get a lot done, not because we're smart, but because we have thumbs so we can make coffee." --Flash Rosenberg