org.rhq.core.pc.drift
Class FilterFileVisitor
java.lang.Object
org.rhq.core.pc.drift.FilterFileVisitor
- All Implemented Interfaces:
- org.rhq.core.util.file.FileVisitor
public class FilterFileVisitor
- extends Object
- implements org.rhq.core.util.file.FileVisitor
A file visitor that peforms filtering using specified filters. When a file matches a
filter this visitor delegates to another FileVisitor object. The filtering rules
are as follows:
- When no filters are specified, are files are considered matches.
-
When one or more includes filters is specified and no excludes filters are
specified, only files matching at least one of the includes filter(s) are
considered matches.
-
When one or more excludes filters is specified and no includes filters are
specified, only files that do not match any of the excludes filters are
considered matches.
-
When both includes and excludes filters are specified, only files that match at
at least one of the includes and do not match any of the excludes are considered
matches.
Note that the filtering is done on files and not on directories. This is a subtle yet
important distinction. Suppose we have the following filter pattern, *.war, that we apply
to the deploy directory of our JBoss application server. That filter will match things
like foo.war, foo-123.war, or more precisely, any file that ends with .war. The pattern
will not however match things like foo.war/ where foo.war is a directory (i.e., exploded
webapp) since matching is not done on directories. To match the contents of foo.war/
you could use something like *.war/**.
If a filter path denotes a directory and if no pattern is specified, then it is assumed
everything in the directory (including subdirectories) should be considered a match.
|
Constructor Summary |
FilterFileVisitor(File basedir,
List<org.rhq.core.domain.drift.Filter> includes,
List<org.rhq.core.domain.drift.Filter> excludes,
org.rhq.core.util.file.FileVisitor visitor)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FilterFileVisitor
public FilterFileVisitor(File basedir,
List<org.rhq.core.domain.drift.Filter> includes,
List<org.rhq.core.domain.drift.Filter> excludes,
org.rhq.core.util.file.FileVisitor visitor)
visit
public void visit(File file)
- Specified by:
visit in interface org.rhq.core.util.file.FileVisitor
Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.