Erik1984
August 17th, 2013, 02:45 PM
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:
I:\Web
In Ubuntu it's mounted as
/media/win8data/Web
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?
In Windows the path to that folder is:
I:\Web
In Ubuntu it's mounted as
/media/win8data/Web
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?