Package org.springframework.util

Examples of org.springframework.util.AntPathMatcher$AntPatternComparator


    private PathMatcher pathMatcher;

    public ValidationContextHandlerInterceptor() {
        validationContextUrlMappings = new ValidationContextUrlMapping[0];
        pathMatcher = new AntPathMatcher();
    }
View Full Code Here


    }

    protected List createResources(Element resourcesDefinition) {
        String dirName = resourcesDefinition.getAttribute(DIR_ATTR);
        final String pattern = resourcesDefinition.getAttribute(PATTERN_ATTR);
        final AntPathMatcher matcher = new AntPathMatcher();
        FileFilter filter = new FileFilter() {
            @Override
            public boolean accept(File file) {
                return matcher.match(pattern, file.getName());
            }
        };
        List resources = new ArrayList();
        for (Iterator files = new FileIterator(dirName, filter); files.hasNext();) {
            File file = (File) files.next();
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

    return false;
  }

  @Override
  public boolean pathMatchesOneOfIncluded(String path, List<String> includePatterns) {
    AntPathMatcher antPathMatcher = new AntPathMatcher();
    for (String includePattern : includePatterns) {
      Assert.notNull(includePattern, "Include patterns should never be null");
      if (antPathMatcher.match(includePattern, path)) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

      return response.getOutputStream();
    }
  }

  private boolean matchesCompressedMimeTypes(String mimeType) {
    PathMatcher pathMatcher = new AntPathMatcher();
    for (String compressedMimeType : compressedMimeTypes) {
      if (pathMatcher.match(compressedMimeType, mimeType)) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

  private boolean isAllowed(String resourcePath) {
    if (resourcePath.matches(protectedPath)) {
      return false;
    }
    PathMatcher pathMatcher = new AntPathMatcher();
    for (String pattern : allowedResourcePaths) {
      if (pathMatcher.match(pattern, resourcePath)) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

        return artifact;
      }
    }
   
    if (parent.getClassNamePattern().size() > 0) {
      AntPathMatcher matcher = new AntPathMatcher();
      matcher.setPathSeparator(".");
     
      for (ClassNamePattern pattern : parent.getClassNamePattern()) {
        if (matcher.match(pattern.getPattern(), className)) {
          boolean ok = true;
          for (String exclude : pattern.getExclude()) {
            if (matcher.match(exclude, className)) {
              ok = false;
            }
          }
          if (ok) {
            return pattern;
View Full Code Here

                    }
                }
                return result.toArray(new Resource[result.size()]);
            }
        };
        resourceResolver.setPathMatcher(new AntPathMatcher() {
            @Override
            public boolean match(String pattern, String path) {
                if (path.endsWith(".class")) {
                    String filename = GrailsStringUtils.getFileBasename(path);
                    if (filename.contains("$")) return false;
View Full Code Here

            for (Artifact artifact : dependencies) {
                if ("jar".equals(artifact.getType())) {
                    resolver.resolve(artifact, remoteRepos, localRepository);

                    AntPathMatcher matcher = new AntPathMatcher();
                    ZipFile zipFile;
                    zipFile = new ZipFile(artifact.getFile());
                    try {
                        Enumeration<? extends ZipEntry> entryEnum = zipFile.entries();
                        while (entryEnum.hasMoreElements()) {
                            ZipEntry zipEntry = entryEnum.nextElement();
                            for (String pattern : wiringPathPatterns) {
                                if (matcher.match(pattern, zipEntry.getName())) {
                                    foundAtLeastOneWiring = true;
                                    log.info("Reading " + zipEntry.getName() + " from " + artifact.getFile());
                                    Set<Artifact> moduleArtifacts = getModuleArtifactsFromLilyRuntimeConfig(
                                            zipFile.getInputStream(zipEntry), zipEntry.getName(), remoteRepos);
View Full Code Here

TOP

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

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.