private static Properties read(File propertiesFile) throws GuacamoleException {

        // Fail early if file simply does not exist
        if (!propertiesFile.exists())
            throw new GuacamoleServerException(String.format("\"%s\" does not "
                    + "exist.", propertiesFile));

        // Load properties from stream, if any, always closing stream when done
        Properties properties = new Properties();
        try (InputStream stream = new FileInputStream(propertiesFile)) {
            properties.load(stream);
        }
        catch (IOException e) {
            throw new GuacamoleServerException(String.format("\"%s\" cannot "
                    + "be read: %s", propertiesFile, e.getMessage()), e);
        }

        return properties;
        
    }
Reads the given Java properties file, storing all property name/value
pairs in a new {@link Properties} object.

@param propertiesFile
    The Java properties file to read.

@return
    A new Properties containing all property name/value pairs defined in
    the given file.

@throws GuacamoleException
    If an error prevents reading the given Java properties file.
guacamole-ext/src/main/java/org/apache/guacamole/properties/FileGuacamoleProperties.java