Class ConditionalRequestsUtil


  • public class ConditionalRequestsUtil
    extends Object
    Utilities related to http://tools.ietf.org/html/rfc7232
    • Constructor Detail

      • ConditionalRequestsUtil

        public ConditionalRequestsUtil()
    • Method Detail

      • isRequestHasMatchingETag

        public static boolean isRequestHasMatchingETag​(@NotNull
                                                       javax.servlet.http.HttpServletRequest request,
                                                       @NotNull
                                                       String etag,
                                                       boolean weak)
        Checks if one of provided values of If-None-Match header of the given request matches given etag accounting for strong/weak comparison types.
        Parameters:
        request - header holder
        etag - value to check matches with
        weak - indicates etag type
        Returns:
        true if etag equals to one of given list of etag values, false otherwise.
        See Also:
        isETagsEquals(java.lang.String, java.lang.String, boolean)
      • isETagsEquals

        public static boolean isETagsEquals​(@NotNull
                                            String t1,
                                            @NotNull
                                            String t2,
                                            boolean weak)
        Checks ETag equalty according to standard.
        See Also:
        RFC 7232
      • getIfNoneMatchValues

        @NotNull
        public static List<String> getIfNoneMatchValues​(@NotNull
                                                        javax.servlet.http.HttpServletRequest request)
      • splitCommaSeparatedHeaderValue

        @NotNull
        public static List<String> splitCommaSeparatedHeaderValue​(@NotNull
                                                                  String header)