Package org.springframework.util

Examples of org.springframework.util.AntPathMatcher$PathSeparatorPatternCache


    // Given
    String pattern = "**/something";
    String path = "/one/two/three/something";

    // When
    String pathWithinPattern = new AntPathMatcher().extractPathWithinPattern(pattern, path);

    // Then
    assertEquals("/one/two/three/something", pathWithinPattern);
  }
View Full Code Here


   * Default is AntPathMatcher.
   * @see #setAllowedResources
   * @see org.springframework.util.AntPathMatcher
   */
  protected PathMatcher getPathMatcher() {
    return new AntPathMatcher();
  }
View Full Code Here

      PathMatcher pathMatcher, boolean useSuffixPatternMatch, boolean useTrailingSlashMatch,
      List<String> fileExtensions) {

    this.patterns = Collections.unmodifiableSet(prependLeadingSlash(patterns));
    this.pathHelper = urlPathHelper != null ? urlPathHelper : new UrlPathHelper();
    this.pathMatcher = pathMatcher != null ? pathMatcher : new AntPathMatcher();
    this.useSuffixPatternMatch = useSuffixPatternMatch;
    this.useTrailingSlashMatch = useTrailingSlashMatch;
    if (fileExtensions != null) {
      for (String fileExtension : fileExtensions) {
        if (fileExtension.charAt(0) != '.') {
View Full Code Here

  public PathMatcher mvcPathMatcher() {
    if (getPathMatchConfigurer().getPathMatcher() != null) {
      return getPathMatchConfigurer().getPathMatcher();
    }
    else {
      return new AntPathMatcher();
    }
  }
View Full Code Here

    assertEquals(Collections.emptyList(), getInterceptorsForPath("/path1/secret"));
  }


  private List<HandlerInterceptor> getInterceptorsForPath(String lookupPath) {
    PathMatcher pathMatcher = new AntPathMatcher();
    List<HandlerInterceptor> result = new ArrayList<HandlerInterceptor>();
    for (Object interceptor : this.registry.getInterceptors()) {
      if (interceptor instanceof MappedInterceptor) {
        MappedInterceptor mappedInterceptor = (MappedInterceptor) interceptor;
        if (mappedInterceptor.matches(lookupPath, pathMatcher)) {
View Full Code Here

  public DestinationPatternsMessageCondition(String[] patterns, PathMatcher pathMatcher) {
    this(asList(patterns), pathMatcher);
  }

  private DestinationPatternsMessageCondition(Collection<String> patterns, PathMatcher pathMatcher) {
    this.pathMatcher = (pathMatcher != null ? pathMatcher : new AntPathMatcher());
    this.patterns = Collections.unmodifiableSet(prependLeadingSlash(patterns, this.pathMatcher));
  }
View Full Code Here

    @Override
    protected void configureMessageBroker(MessageBrokerRegistry registry) {
      registry.configureBrokerChannel().setInterceptors(this.interceptor, this.interceptor, this.interceptor);
      registry.configureBrokerChannel().taskExecutor().corePoolSize(31).maxPoolSize(32).keepAliveSeconds(33).queueCapacity(34);
      registry.setPathMatcher(new AntPathMatcher(".")).enableSimpleBroker("/topic", "/queue");
    }
View Full Code Here

  @Test
  public void dotPathSeparator() {
    DotPathSeparatorController controller = new DotPathSeparatorController();

    this.messageHandler.setPathMatcher(new AntPathMatcher("."));
    this.messageHandler.registerHandler(controller);
    this.messageHandler.setDestinationPrefixes(Arrays.asList("/app1", "/app2/"));

    SimpMessageHeaderAccessor headers = SimpMessageHeaderAccessor.create();
    headers.setSessionId("session1");
View Full Code Here

   * Default is AntPathMatcher.
   * @see #setAllowedResources
   * @see org.springframework.util.AntPathMatcher
   */
  protected PathMatcher getPathMatcher() {
    return new AntPathMatcher();
  }
View Full Code Here

                    handlerInterceptors.add((HandlerInterceptor) interceptor);
                } else if (interceptor instanceof WebRequestInterceptor) {
                    handlerInterceptors.add(new WebRequestHandlerInterceptorAdapter((WebRequestInterceptor) interceptor));
                } else if (interceptor instanceof MappedInterceptor) {
                    handlerInterceptors.add(new MappedInterceptorAdapter((MappedInterceptor)interceptor,
                            new UrlPathHelper(), new AntPathMatcher()));
                }
            }
        }

        return handlerInterceptors;
View Full Code Here

TOP

Related Classes of org.springframework.util.AntPathMatcher$PathSeparatorPatternCache

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.