I am already familiar with creating files and putting them in "user.home". I'm on Mac, so don't know much about PC's folder, but in my library, there is Application Support. Is there a way to place a directory there and also in PC's %appdata%?
You can view the AppData folder manually by going into your Users folder, which is there in the C drive. In my case, the path is C:\Users\ADMIN .
Any program or package which contains or requires data that doesn't need to be modified should store that data in /usr/share (or /usr/local/share , if installed locally). It is recommended that a subdirectory be used in /usr/share for this purpose. Applications using a single file may use /usr/share/misc .
The AppData folder on Windows is "{user.home}\Local Settings\ApplicationData";
You can get it using this:
String dataFolder = System.getProperty("user.home") + "\\Local Settings\\ApplicationData";
or by this, but it's only works on Windows because the env variable 'APPDATA' only available under Windows.
String dataFolder = System.getenv("APPDATA");
Fore more information, you can check it out How to get local application data folder in Java?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With