Class HeaderUtils


  • public final class HeaderUtils
    extends java.lang.Object
    • Method Detail

      • containsPrivate

        public static boolean containsPrivate​(WebResponse response)
        Parameters:
        response - WebResponse
        Returns:
        if 'Cache-Control' header is present and contains 'private' value
      • containsPublic

        public static boolean containsPublic​(WebResponse response)
        Parameters:
        response - WebResponse
        Returns:
        if 'Cache-Control' header is present and contains 'public' value
      • containsNoStore

        public static boolean containsNoStore​(WebResponse response)
        Parameters:
        response - WebResponse
        Returns:
        if 'Cache-Control' header is present and contains 'no-store' value
      • containsNoCache

        public static boolean containsNoCache​(WebResponse response)
        Parameters:
        response - WebResponse
        Returns:
        if 'Cache-Control' header is present and contains 'no-cache' value@return
      • containsETag

        public static boolean containsETag​(WebResponse response)
        Parameters:
        response - WebResponse
        Returns:
        if 'Etag' header is present
      • containsLastModified

        public static boolean containsLastModified​(WebResponse response)
        Parameters:
        response - WebResponse
        Returns:
        if 'Last-Modified' header is present
      • containsSMaxage

        public static boolean containsSMaxage​(WebResponse response)
        Parameters:
        response - WebResponse
        Returns:
        if 'Cache-Control' header is present and contains 's-maxage' value
      • containsMaxAge

        public static boolean containsMaxAge​(WebResponse response)
        Parameters:
        response - WebResponse
        Returns:
        if 'Cache-Control' header is present and contains 'max-age' value
      • containsMaxAgeOrSMaxage

        public static boolean containsMaxAgeOrSMaxage​(WebResponse response)
        Parameters:
        response - WebResponse
        Returns:
        if 'Cache-Control' header is present and contains 'max-age' value
      • sMaxage

        public static long sMaxage​(WebResponse response)
        Parameters:
        response - WebResponse
        Returns:
        value of 's-maxage' directive and 0 if it is absent
      • maxAge

        public static long maxAge​(WebResponse response)
        Parameters:
        response - WebResponse
        Returns:
        value of 'max-age' directive and 0 if it is absent