diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathSuffixFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathSuffixFilter.java index 2c1f20d62..f54cbeae2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathSuffixFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathSuffixFilter.java @@ -52,17 +52,25 @@ import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.treewalk.TreeWalk; /** - * Includes tree entries only if they match the configured path. + * Includes tree entries only if they end with the configured path (suffix + * match). + *
+ * For example, PathSuffixFilter.create(".txt")
will match all
+ * paths ending in .txt
.
+ *
+ * Using this filter is recommended instead of filtering the entries using
+ * {@link TreeWalk#getPathString()} and endsWith
or some other type
+ * of string match function.
*/
public class PathSuffixFilter extends TreeFilter {
/**
- * Create a new tree filter for a user supplied path.
+ * Create a new tree filter for a user supplied path suffix.
*
* Path strings use '/' to delimit directories on all platforms. * * @param path - * the path (suffix) to filter on. Must not be the empty string. + * the path suffix to filter on. Must not be the empty string. * @return a new filter for the requested path. * @throws IllegalArgumentException * the path supplied was the empty string.