private static File findGuacamoleHome() {

        // Attempt to find Guacamole home
        File guacHome;

        // Use system property by default
        String desiredDir = System.getProperty("guacamole.home");

        // Failing that, try the GUACAMOLE_HOME environment variable
        if (desiredDir == null) desiredDir = System.getenv("GUACAMOLE_HOME");

        // If successful, use explicitly specified directory
        if (desiredDir != null)
            guacHome = new File(desiredDir);

        // If not explicitly specified, use standard locations
        else {

            // Try ~/.guacamole first
            guacHome = new File(System.getProperty("user.home"), ".guacamole");

            // If that doesn't exist, try /etc/guacamole if the /etc directory
            // exists on this system
            if (!guacHome.exists() && new File("/etc").exists())
                guacHome = new File("/etc/guacamole");

        }

        // Return discovered directory
        return guacHome;

    }
Locates the Guacamole home directory by checking, in order:
the guacamole.home system property, the GUACAMOLE_HOME environment
variable, and finally the .guacamole directory in the home directory of
the user running the servlet container. If even the .guacamole directory
doesn't exist, then /etc/guacamole will be used.

@return The File representing the Guacamole home directory, which may
        or may not exist, and may turn out to not be a directory.
guacamole-ext/src/main/java/org/apache/guacamole/environment/LocalEnvironment.java