private String readFileContentsIntoString(File file, String name) throws GuacamoleException {

        // Attempt to read the file directly into a String
        try {
            return new String(Files.readAllBytes(file.toPath()), StandardCharsets.UTF_8);
        }

        // If the file cannot be read, log a warning and treat it as if it does not exist
        catch (IOException e) {
            throw new GuacamoleServerException(
                    name + " at \"" + file.getAbsolutePath() + "\" could not be read.", e);
        }

    }
Returns the contents of a small file, such as a private key or certificate into
a String. If the file does not exist, or cannot be read for any reason, an exception
will be thrown with the details of the failure.

@param file
    The file to read into a string.

@param name
    A human-readable name for the file, to be used when formatting log messages.

@return
    The contents of the file having the given path.

@throws GuacamoleException
    If the provided file does not exist, or cannot be read for any reason.
extensions/guacamole-auth-sso/modules/guacamole-auth-sso-saml/src/main/java/org/apache/guacamole/auth/saml/conf/ConfigurationService.java