Class CmsProtectedStaticFileHandler

  • All Implemented Interfaces:
    I_CmsConfigurationParameterHandler, I_CmsNeedsAdminCmsObject, I_CmsResourceInit, I_CmsCustomLinkRenderer

    public class CmsProtectedStaticFileHandler
    extends java.lang.Object
    implements I_CmsResourceInit, I_CmsConfigurationParameterHandler, I_CmsNeedsAdminCmsObject, I_CmsCustomLinkRenderer
    Resource init handler that provides an alternative way of serving static files like images or binary files, using the API authorization mechanism instead of the normal authorization handler.

    Resources are accessed by appending their VFS root path to the /staticresource handler path. When resources are requested this way, they are still loaded with the normal OpenCms loader mechanism. This works for the intended use case (binary files, images) but may not work for other types.

    The resources accessible through this handler can be restricted by setting regex configuration parameters for path and type which the requested resources have to match.

    This can be used in combination with the CmsJsonResourceHandler class. When configured correctly (using the linkrewrite.id parameter on this handler, and a matching linkrewrite.refid on the CmsJsonResourceHandler), links to resources this handler is responsible for will be rewritten to point to the URL for the resource using this handler.