Just another coin for the community. <https://sany...
# tornadofx
a
Just another coin for the community. https://sanyarnd.github.io/standardpaths/
StandardPaths
provides the utility class with the most common system- and user- related directories. Features • All major distributions: Windows, Linux, MacOS (not yet, no access to MacOS right now) • Ease of use • NIO-based • Lightweight (~10kb) • JDK8+ support Usage:
Copy code
Path home = StandardPaths.home();
Path cache = StandardPaths.cache();
Someone mentioned
AppDirs
library few weeks ago, I thought about contributing (few advanced methods of retrieving paths with WinAPI), but
AppDirs
is JDK6+ based with WinXP support, while I'm trying to utilize JDK7 NIO as much as I could (e.g.
Path
better than
File
better than
String
) with modern OSes in mind. API difference:
Copy code
Path home = StandardPaths.dataLocal().resolve("<author>/<app>/<ver>")
vs
Copy code
Path home = Paths.get(AppDirsFactory.getInstance().getUserDataDir("<app>", "<ver>", "<author>", true)));
👍 3
e
Very nice library! However "lightweight" is a bit misleading, because of its 2.5MB transitive jni dependency
😅 1
a
I was thinking about it too, that's why I mentioned it twice: core library (single utility class), and one heavy dependency (jna).