org.rhq.core.pc.drift
Class FilterFileVisitor

java.lang.Object
  extended by 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:



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)
           
 
Method Summary
 void visit(File file)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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)
Method Detail

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.