org.eclipse.jgit.treewalk.filter
Class PathFilterGroup

java.lang.Object
  extended by org.eclipse.jgit.treewalk.filter.PathFilterGroup

public class PathFilterGroup
extends Object

Includes tree entries only if they match one or more configured paths.

Operates like PathFilter but causes the walk to abort as soon as the tree can no longer match any of the paths within the group. This may bypass the boolean logic of a higher level AND or OR group, but does improve performance for the common case of examining one or more modified paths.

This filter is effectively an OR group around paths, with the early abort feature described above.


Constructor Summary
PathFilterGroup()
           
 
Method Summary
static TreeFilter create(Collection<PathFilter> paths)
          Create a collection of path filters.
static TreeFilter createFromStrings(Collection<String> paths)
          Create a collection of path filters from Java strings.
static TreeFilter createFromStrings(String... paths)
          Create a collection of path filters from Java strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathFilterGroup

public PathFilterGroup()
Method Detail

createFromStrings

public static TreeFilter createFromStrings(Collection<String> paths)
Create a collection of path filters from Java strings.

Path strings are relative to the root of the repository. If the user's input should be assumed relative to a subdirectory of the repository the caller must prepend the subdirectory's path prior to creating the filter.

Path strings use '/' to delimit directories on all platforms.

Paths may appear in any order within the collection. Sorting may be done internally when the group is constructed if doing so will improve path matching performance.

Parameters:
paths - the paths to test against. Must have at least one entry.
Returns:
a new filter for the list of paths supplied.

createFromStrings

public static TreeFilter createFromStrings(String... paths)
Create a collection of path filters from Java strings.

Path strings are relative to the root of the repository. If the user's input should be assumed relative to a subdirectory of the repository the caller must prepend the subdirectory's path prior to creating the filter.

Path strings use '/' to delimit directories on all platforms.

Paths may appear in any order. Sorting may be done internally when the group is constructed if doing so will improve path matching performance.

Parameters:
paths - the paths to test against. Must have at least one entry.
Returns:
a new filter for the paths supplied.

create

public static TreeFilter create(Collection<PathFilter> paths)
Create a collection of path filters.

Paths may appear in any order within the collection. Sorting may be done internally when the group is constructed if doing so will improve path matching performance.

Parameters:
paths - the paths to test against. Must have at least one entry.
Returns:
a new filter for the list of paths supplied.


Copyright © 2012. All Rights Reserved.