Follow Freedesktop Basedir Spec
Could you follow the Freedesktop Basedir Spec for the system directories (filesDir, etc.). These are provided via environment variable, so you can just fall back to the current value when they are not available.
Hi @recke96! Thanks for creating this issue!
I'm not sure if I understand what you mean. Can you explain in more detail what you need? Thanks 🙏
You provide developers with some system/user directories:
FileKit.filesDirFileKit.cacheDirFileKit.databasesDirFileKit.projectDirFileKit.downloadDirFileKit.pictureDir
For JVM you currently hardcoded path relative to $HOME per platform. Most major Linux desktops follow the Freedesktop spec, that means these directories are configurable by the user and exposed to applications via environment variables. You could check the existence of these variables and fallback to the defaults already in the code.
From your code I believe following environment variables (on Linux) should be checked:
FileKit.filesDir: $XDG_DATA_HOME (fallback to $HOME/.local/share)FileKit.cacheDir: $XDG_CACHE_HOME (fallback to $HOME/.cache)FileKit.downloadDir: $XDG_DOWNLOAD_DIRFileKit.pictureDir: $XDG_PICTURES_DIR
I'm pretty sure MacOs and Windows similarly have these configurable, but I don't know any details. But you can probably find info / code at harawata/appdirs or https://codeberg.org/dirs/directories-jvm.
@recke96 Thanks a lot for your clarification! It would be a great improvement to follow Freedesktop basedir specs.
I'm really interested if you have some time to contribute to the library for implementing this spec! That would help me a lot! At the moment, I don't have too much time to work on it.