Where to store preferences, Log files, Caches on Mac OS X for Java apps

brutuscat :

Where should preference files, log files, caches files, database files, go on Mac OS X and how to get those locations from Java?

brutuscat :

As per [email protected] list by Mike Swingler

Preferences is explained here: Technical Q&A QA1170 Important Java Directories on Mac OS

Logs should probably go into System.getProperty("user.home") + "/Library/Logs/" + "your.app.identifier".

Caches should either go in the directory returned from System.getProperty("java.io.tmpdir"), or System.getProperty("user.home") + "/Library/Caches/" + "your.app.identifier".

Database files, autosave information, and other things that represent user data that could be lost if deleted should go into System.getProperty("user.home") + "/Library/Application Support/" + "Your App Name".

To request a new tech note, or update the existing QA1170 with this information, please file a request at http://bugreporter.apple.com

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=160837&siteId=1