Class PatternsRequestCondition

    • Constructor Detail

      • PatternsRequestCondition

        public PatternsRequestCondition​(String... patterns)
        Creates a new instance with the given URL patterns. Each pattern that is not empty and does not start with "/" is prepended with "/".
        Parameters:
        patterns - 0 or more URL patterns; if 0 the condition will match to every request.
      • PatternsRequestCondition

        public PatternsRequestCondition​(String[] patterns,
                                        @Nullable
                                        UrlPathHelper urlPathHelper,
                                        @Nullable
                                        PathMatcher pathMatcher,
                                        boolean useTrailingSlashMatch)
        Alternative constructor with additional, optional UrlPathHelper, PathMatcher, and whether to automatically match trailing slashes.
        Parameters:
        patterns - the URL patterns to use; if 0, the condition will match to every request.
        urlPathHelper - a UrlPathHelper for determining the lookup path for a request
        pathMatcher - a PathMatcher for pattern path matching
        useTrailingSlashMatch - whether to match irrespective of a trailing slash
        Since:
        5.2.4
      • PatternsRequestCondition

        @Deprecated
        public PatternsRequestCondition​(String[] patterns,
                                        @Nullable
                                        UrlPathHelper urlPathHelper,
                                        @Nullable
                                        PathMatcher pathMatcher,
                                        boolean useSuffixPatternMatch,
                                        boolean useTrailingSlashMatch)
        Deprecated.
        as of 5.2.4. See class-level note in RequestMappingHandlerMapping on the deprecation of path extension config options.
        Alternative constructor with additional optional parameters.
        Parameters:
        patterns - the URL patterns to use; if 0, the condition will match to every request.
        urlPathHelper - for determining the lookup path of a request
        pathMatcher - for path matching with patterns
        useSuffixPatternMatch - whether to enable matching by suffix (".*")
        useTrailingSlashMatch - whether to match irrespective of a trailing slash
      • PatternsRequestCondition

        @Deprecated
        public PatternsRequestCondition​(String[] patterns,
                                        @Nullable
                                        UrlPathHelper urlPathHelper,
                                        @Nullable
                                        PathMatcher pathMatcher,
                                        boolean useSuffixPatternMatch,
                                        boolean useTrailingSlashMatch,
                                        @Nullable
                                        List<String> fileExtensions)
        Deprecated.
        as of 5.2.4. See class-level note in RequestMappingHandlerMapping on the deprecation of path extension config options.
        Alternative constructor with additional optional parameters.
        Parameters:
        patterns - the URL patterns to use; if 0, the condition will match to every request.
        urlPathHelper - a UrlPathHelper for determining the lookup path for a request
        pathMatcher - a PathMatcher for pattern path matching
        useSuffixPatternMatch - whether to enable matching by suffix (".*")
        useTrailingSlashMatch - whether to match irrespective of a trailing slash
        fileExtensions - a list of file extensions to consider for path matching
Parameters:
other - the condition to combine with.
Returns:
a request condition instance that is the result of combining the two condition instances.