Example usage for org.eclipse.jgit.ignore.internal IMatcher matches

List of usage examples for org.eclipse.jgit.ignore.internal IMatcher matches

Introduction

In this page you can find the example usage for org.eclipse.jgit.ignore.internal IMatcher matches.

Prototype

boolean matches(String segment, int startIncl, int endExcl);

Source Link

Document

Matches only part of given string

Usage

From source file:org.springsource.ide.eclipse.commons.quicksearch.core.pathmatch.ResourceMatchers.java

License:Open Source License

private static ResourceMatcher path(String path) {
    try {//from  ww w.j  a  v  a2 s . com
        IMatcher matcher = PathMatcher.createPathMatcher(path, '/', false);
        return new ResourceMatcher() {

            @Override
            public String toString() {
                return path;
            }

            @Override
            public boolean matches(IResource resource) {
                return matcher.matches(resource.getFullPath().toString(),
                        resource.getType() == IResource.FOLDER, false);
            }
        };

    } catch (InvalidPatternException e) {
        return ANY;
    }
}