private void configureAliasChecks(ServletContextHandler context, boolean shouldServeAlias) {
    if (shouldServeAlias) {
      Class aliasCheckerClass = SymlinkAllowedResourceAliasChecker.class;
      // check if SymlinkAllowedResourceAliasChecker is already part of alias check list
      // NOTE: we are doing this because this is already present in the context (by default)
      if (context.getAliasChecks().stream().anyMatch(aliasCheckerClass::isInstance)) {
        LOG.debug("{} is already part of alias check list", aliasCheckerClass.getName());
      } else {
        context.addAliasCheck(new SymlinkAllowedResourceAliasChecker(context));
        LOG.debug("{} added to the alias check list", aliasCheckerClass.getName());
      }
      LOG.info("Serving aliases allowed for /logs context");
    } else {
      // if aliasing is disabled, then we should clear the alias check list
      context.clearAliasChecks();
      LOG.info("Serving aliases disabled for /logs context");
    }
  }
This method configures the alias checks for the given ServletContextHandler based on the
provided value of shouldServeAlias.<br>
If shouldServeAlias is set to true, it checks if SymlinkAllowedResourceAliasChecker is already
a part of the alias check list. If it is already a part of the list, no changes are made, else,
it adds it to the list.<br>
If shouldServeAlias is set to false, it clears all alias checks from the
ServletContextHandler.<br>
.
@param context          The ServletContextHandler whose alias checks are to be configured
@param shouldServeAlias Whether aliases should be allowed or not
hbase-http/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java