Class StaticFilesConfiguration


  • public class StaticFilesConfiguration
    extends java.lang.Object
    Holds the static file configuration. TODO: ETAG ?
    • Field Detail

      • LOG

        private final org.slf4j.Logger LOG
      • staticResourcesSet

        private boolean staticResourcesSet
      • externalStaticResourcesSet

        private boolean externalStaticResourcesSet
      • customHeaders

        private java.util.Map<java.lang.String,​java.lang.String> customHeaders
    • Constructor Detail

      • StaticFilesConfiguration

        public StaticFilesConfiguration()
    • Method Detail

      • consume

        public boolean consume​(javax.servlet.http.HttpServletRequest httpRequest,
                               javax.servlet.http.HttpServletResponse httpResponse)
                        throws java.io.IOException
        Attempt consuming using either static resource handlers or jar resource handlers
        Parameters:
        httpRequest - The HTTP servlet request.
        httpResponse - The HTTP servlet response.
        Returns:
        true if consumed, false otherwise.
        Throws:
        java.io.IOException - in case of IO error.
      • consumeWithFileResourceHandlers

        private boolean consumeWithFileResourceHandlers​(javax.servlet.http.HttpServletRequest httpRequest,
                                                        javax.servlet.http.HttpServletResponse httpResponse)
                                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • clear

        public void clear()
        Clears all static file configuration
      • isStaticResourcesSet

        public boolean isStaticResourcesSet()
      • isExternalStaticResourcesSet

        public boolean isExternalStaticResourcesSet()
      • configure

        public void configure​(java.lang.String folder)
        Configures location for static resources
        Parameters:
        folder - the location
      • configureExternal

        public void configureExternal​(java.lang.String folder)
        Configures location for static resources
        Parameters:
        folder - the location
      • setExpireTimeSeconds

        public void setExpireTimeSeconds​(long expireTimeSeconds)
      • putCustomHeaders

        public void putCustomHeaders​(java.util.Map<java.lang.String,​java.lang.String> headers)
      • putCustomHeader

        public void putCustomHeader​(java.lang.String key,
                                    java.lang.String value)