jitsi / libjitsi

Advanced Java media library for secure real-time audio/video communication.
Apache License 2.0
628 stars 281 forks source link

Use Freedesktop's XDG User Dirs under linux #518

Open Cybso opened 4 years ago

Cybso commented 4 years ago

From FileAccessServiceImpl.java:

    public File getDefaultDownloadDirectory() throws IOException {
        if (OSUtils.IS_WINDOWS) {
        ....
        }
        // For all other operating systems we return the Downloads folder.
        return new File(getSystemProperty("user.home"), "Downloads");
    }

On Unix systems, this behavior is wrong. Instead, the download directory should be read from "~/.config/user-dirs.dirs":

XDG_DESKTOP_DIR="$HOME/desktop/"
XDG_DOWNLOAD_DIR="$HOME/downloads"
....

This results in the creation of a new directory "Downloads" next to "downloads" on my system.

Alternatively, the download directory should be configurable.

There's also a lib called xdg-java here on Github: https://github.com/omajid/xdg-java