private JsonNode parseLanguageResource(Resource resource) throws IOException {

        // Get resource stream
        InputStream stream = resource.asStream();
        if (stream == null)
            return null;

        // Parse JSON tree
        try {
            JsonNode tree = mapper.readTree(stream);
            return tree;
        }

        // Ensure stream is always closed
        finally {
            stream.close();
        }

    }
Parses the given language resource, returning the resulting JsonNode.
If the resource cannot be read because it does not exist, null is
returned.

@param resource
    The language resource to parse. Language resources must have the
    mimetype "application/json".

@return
    A JsonNode representing the root of the parsed JSON tree, or null if
    the given resource does not exist.

@throws IOException
    If an error occurs while parsing the resource as JSON.
guacamole/src/main/java/org/apache/guacamole/extension/LanguageResourceService.java