protected ServletContextHandler createStaticContentHandler()
    {
        final File spankDirectory = new File( JiveGlobals.getHomePath() + File.separator + "resources" + File.separator + "spank" );
        if ( spankDirectory.exists() )
        {
            if ( spankDirectory.canRead() )
            {
                final WebAppContext context = new WebAppContext( null, spankDirectory.getPath(), "/" );
                context.setInitParameter("org.eclipse.jetty.servlet.Default.dirAllowed", "false");

                context.setWelcomeFiles( new String[] { "index.html" } );

                // Add CSP headers for all HTTP responses (errors, etc.)
                context.addFilter(HttpBindContentSecurityPolicyFilter.class, "/*", EnumSet.allOf(DispatcherType.class));

                return context;
            }
            else
            {
                Log.warn( "Openfire cannot read the directory: " + spankDirectory );
            }
        }
        return null;
    }
Creates a Jetty context handler that can be used to expose static files.

Note that an invocation of this method will not register the handler (and thus make the related functionality
available to the end user). Instead, the created handler is returned by this method, and will need to be
registered with the embedded Jetty webserver by the caller.

@return A Jetty context handler, or null when the static content could not be accessed.
xmppserver/src/main/java/org/jivesoftware/openfire/http/HttpBindManager.java