Tabnine Logo
PathMatcher.isPattern
Code IndexAdd Tabnine to your IDE (free)

How to use
isPattern
method
in
leap.lang.path.PathMatcher

Best Java code snippets using leap.lang.path.PathMatcher.isPattern (Showing top 4 results out of 315)

origin: org.leapframework/leap-lang

@Override
public String extractRootDirPath(String location) {
  int prefixEnd = location.indexOf(":") + 1;
  int rootDirEnd = location.length();
  while (rootDirEnd > prefixEnd && getPathMatcher().isPattern(location.substring(prefixEnd, rootDirEnd))) {
    rootDirEnd = location.lastIndexOf('/', rootDirEnd - 2) + 1;
  }
  if (rootDirEnd == 0) {
    rootDirEnd = prefixEnd;
  }
  return location.substring(0, rootDirEnd);
}
origin: org.leapframework/leap-core

public PathPatternRequestMatcher(String path,PathMatcher matcher, boolean ignroeCase) {
  Args.notNull(path);
  Args.notNull(matcher);
  this.path       = path;
  this.matcher    = matcher;
  this.isPattern  = matcher.isPattern(path);
  this.ignoreCase = ignroeCase;
  this.pattern    = ignroeCase ? path.toLowerCase() : path;
}

origin: org.leapframework/leap-core

protected void parsePatterns(String patterns){
  if(!Strings.isEmpty(patterns)){
    if(ignoreCase){
      patterns = patterns.toLowerCase();
    }
    
    Set<String> set = new LinkedHashSet<String>();
    
    String[] lines = Strings.splitMultiLines(patterns);
    
    for(String line : lines){
      if(!Strings.isEmpty(line = line.trim())){
        if(!line.startsWith("/")){
          line = "/" + line;
        }
        
        if(!patternMatcher.isPattern(line)){
          throw new IllegalArgumentException("'" + line + "' is not a valid ant path pattern");
        }
        
        set.add(line);
      }
    }
    
    if(!set.isEmpty()){
      this.patterns = set.toArray(new String[set.size()]);
    }
  }
}
origin: org.leapframework/leap-lang

public Resource[] scan(String locationPattern) throws IOException {
  Args.notNull(locationPattern, "Location pattern");
  if (locationPattern.startsWith(Urls.CLASSPATH_ALL_URL_PREFIX)) {
    String locationPatternWithPrefix = locationPattern.substring(Urls.CLASSPATH_ALL_URL_PREFIX.length());
    
    // a class path resource (multiple resources for same name possible)
    if (getPathMatcher().isPattern(locationPatternWithPrefix)) {
      // a class path resource pattern
      return findPathMatchingResources(locationPattern);
    } else {
      // all class path resources with the given name
      return findAllClassPathResources(locationPatternWithPrefix);
    }
  } else {
    // Only look for a pattern after a prefix here
    // (to not get fooled by a pattern symbol in a strange prefix).
    int prefixEnd = locationPattern.indexOf(":") + 1;
    if (getPathMatcher().isPattern(locationPattern.substring(prefixEnd))) {
      // a file pattern
      return findPathMatchingResources(locationPattern);
    } else {
      // a single resource with the given name
      return new Resource[] {getResourceLoader().getResource(locationPattern)};
    }
  }
}
leap.lang.pathPathMatcherisPattern

Popular methods of PathMatcher

  • match
  • matchStart

Popular in Java

  • Making http post requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • compareTo (BigDecimal)
  • setRequestProperty (URLConnection)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JComboBox (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now