Hello
I have a Web Start application which needs to save a single text file. I would like to know where I should write the file, such that it goes in a tidy place regardless of the platform it runs on.
If I get my filepath like this...
new File(System.getProperty("user.dir") + System.getProperty("file.separator") + "test.txt);
... then the file gets written somewhere nice and inconspicuous on Linux, but on the desktop on Windows, alongside the icon I'm running the program from, and that's not ideal because the user shouldn't necessarily need to know or care that the file exists.
Is there a good, platform-independent way of getting a file path that allows me to save a file somewhere discreet? I don't much care where it ends up, providing it's not in full view on the desktop.
Thanks.
Neil