public String filter(String input) {

        // Filter with strict mode disabled (should always succeed)
        try {
            return filter(input, false);
        }

        // GuacamoleTokenUndefinedException cannot be thrown when strict mode
        // is disabled
        catch (GuacamoleTokenUndefinedException e) {
            throw new IllegalStateException("filter() threw "
                    + "GuacamoleTokenUndefinedException despite strict mode "
                    + "being disabled.");
        }

    }
Filters the given string, replacing any tokens with their corresponding
values. Any tokens present in the given string which lack values will
be interpreted as literals.

@param input
    The string to filter.

@return
    A copy of the input string, with any tokens replaced with their
    corresponding values.
guacamole-ext/src/main/java/org/apache/guacamole/token/TokenFilter.java