Package org.springframework.util

Examples of org.springframework.util.AntPathMatcher$AntPathStringMatcher


        }
        return new ArrayList<HeaderDeclaration>(0);
    }

    public final boolean canAnalyse(String artefactName) {
        AntPathMatcher matcher = new AntPathMatcher();
        for (String contextPath : this.contextPaths) {
            if (matcher.match(contextPath, artefactName)) {
                return true;
            }
        }
        return false;
    }
View Full Code Here


  public boolean matches(Saveable saveable, File file) {
    if (file == null) {
      return false;
    }
    String filePathRelativeToHudsonRoot = JenkinsFilesHelper.buildPathRelativeToHudsonRoot(file);
        AntPathMatcher matcher = new AntPathMatcher();
        for(String pattern : includesPatterns) {
            if(matcher.match(pattern, filePathRelativeToHudsonRoot)){
                return true;
            }
    }
    return false;
  }
View Full Code Here

            final String path = (String) data[2];

            Assert.assertEquals(
                    "expects " + expected + " path '" + path + "' matches '" + pattern + "'",
                    expected,
                    new AntPathMatcher().match(pattern, path));
        }
    }
View Full Code Here

            final String path = (String) data[2];

            Assert.assertEquals(
                    "expects " + expected + " path '" + path + "' matches '" + pattern + "'",
                    expected,
                    new AntPathMatcher().match(pattern, path));
        }
    }
View Full Code Here

// Negative means we prefer the first argument when both patterns match
public class ReproTests {

  @Test
  public void patternComparatorWithHierarchicalMatchAccidentalPass() {
    Comparator<String> comparator = new AntPathMatcher().getPatternComparator("/hotels/new");
    // This passes accidentally: the order is correct but for the wrong reason
    assertTrue(comparator.compare("/hotels/{hotel}", "/hotels/**") < 0);
  }
View Full Code Here

    assertTrue(comparator.compare("/hotels/{hotel}", "/hotels/**") < 0);
  }

  @Test
  public void patternComparatorWithHierarchicalMatchBracketsPreferred() {
    Comparator<String> comparator = new AntPathMatcher().getPatternComparator("/hotels/new/123");
    // This passes accidentally: the order is correct but for the wrong reason
    assertTrue(comparator.compare("/hotels/{hotel}/{booking}", "/hotels/**") < 0);
  }
View Full Code Here

    assertTrue(comparator.compare("/hotels/{hotel}/{booking}", "/hotels/**") < 0);
  }

  @Test
  public void patternComparatorWithHierarchicalMatch() {
    Comparator<String> comparator = new AntPathMatcher().getPatternComparator("/hotels/new/123");
    // This fails, even though the first path is clearly more specific
    assertTrue(comparator.compare("/hotels/{hotel}/**", "/**") < 0);
  }
View Full Code Here

    assertTrue(comparator.compare("/hotels/{hotel}/**", "/**") < 0);
  }

  @Test
  public void patternComparatorWithHierarchicalMatchWithWorkaround() {
    Comparator<String> comparator = new AntPathMatcher().getPatternComparator("/hotels/new/123");
    // This is a workaround
    assertTrue(comparator.compare("/hotels/{hotel}/**", "/**/**") < 0);
  }
View Full Code Here

   * org.springframework.web.bind.support.WebDataBinderFactory)
   */
  @Override
  public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
          NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
    AntPathMatcher pathMatcher = new AntPathMatcher();
    RequestMapping requestMappingOnMethod = parameter.getMethodAnnotation(RequestMapping.class);
    RequestMapping requestMappingOnClass = getDeclaringClassRequestMapping(parameter);
    String combine = pathMatcher.combine(requestMappingOnClass.value()[0], requestMappingOnMethod.value()[0]);
    return PathUtils.removePrependedSlash(pathMatcher.extractPathWithinPattern(combine, (String) webRequest
        .getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE,
            NativeWebRequest.SCOPE_REQUEST)));
  }
View Full Code Here

  @Override
  public void configureMessageBroker(MessageBrokerRegistry registry) {
    registry.enableSimpleBroker("/queue/", "/topic/");
//    registry.enableStompBrokerRelay("/queue/", "/topic/");
    registry.setApplicationDestinationPrefixes("/app");
    registry.setPathMatcher(new AntPathMatcher("."));
  }
View Full Code Here

TOP

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

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.