@Override
    public DirectoryObjectResource<ConnectionGroup, APIConnectionGroup>
        getObjectResource(String identifier) throws GuacamoleException {

        UserContext userContext = getUserContext();

        // Use root group if identifier is the standard root identifier
        if (identifier != null && identifier.equals(APIConnectionGroup.ROOT_IDENTIFIER))
            return getResourceFactory().create(getAuthenticatedUser(), userContext, getDirectory(),
                    userContext.getRootConnectionGroup());

        return super.getObjectResource(identifier);

    }
Creates a new ConnectionGroupDirectoryResource which exposes the
operations and subresources available for the given ConnectionGroup
Directory.

@param authenticatedUser
    The user that is accessing this resource.

@param userContext
    The UserContext associated with the given Directory.

@param directory
    The Directory being exposed.

@param translator
    A DirectoryObjectTranslator implementation which handles
    ConnectionGroups.

@param resourceFactory
    A factory which can be used to create instances of resources
    representing ConnectionGroups.
guacamole/src/main/java/org/apache/guacamole/rest/connectiongroup/ConnectionGroupDirectoryResource.java