I'm building a Java desktop application and need to store some local data (preferences and history). For this I'd like to create a new folder in the appropriate location, like AppData\myapp in Windows and ~/.myapp in Linux (and wherever is expected on a Mac).
What is the nice, cross-platform way to do that?
I've seen several questions on this site that ask about this, but either:
- The asker wants to find Windows' Application Data (not cross-platform)
- The solution is to create a folder in
user.home
(Linux style, not cross-platform) This is what I currently do, but I'm looking for an improvement.