private void setActiveEmbededPolicy()

in src/main/java/org/apache/sling/xss/impl/XSSFilterImpl.java [305:324]


    private void setActiveEmbededPolicy() {
            // the content was not installed but the service is active; let's use the embedded file for the default handler
            logger.info("Could not find a policy file at the configured location {}. Attempting to use the default resource embedded in" +
                    " the bundle.", policyPath);
            activePolicy = new AntiSamyPolicy(true, EMBEDDED_POLICY_PATH);
            try (InputStream policyStream = activePolicy.read()) {
                setPolicyHandler(new PolicyHandler(policyStream));
                logger.info("Installed policy from the embedded {} file from the bundle.", activePolicy.path);
            } catch (Exception e) {
                activePolicy = null;
                Throwable[] suppressed = e.getSuppressed();
                if (suppressed.length > 0) {
                    for (Throwable t : suppressed) {
                        logger.error("Unable to load policy from embedded policy file.", t);
                    }
                }
                logger.error("Unable to load policy from embedded policy file.", e);
            }
        
    }