Claudenw commented on code in PR #160:
URL: https://github.com/apache/creadur-rat/pull/160#discussion_r1377289839


##########
apache-rat-core/src/main/java/org/apache/rat/walker/DirectoryWalker.java:
##########


Review Comment:
   I agree. However, if we switch to 
org.apache.commons.io.filefilter.AbstractFileFilter we can merge multiple 
filters together.
   
    What we can do is modify the ReportConfiguration so that
   
   - by default set the directory filter to ignore dot prefixed directories.
   - if addDirectoryFilter() is called with NULL we remove the directory filter.
   - If addDirectoryFilter() is called with a non-null argument then the 
argument is "and"ed to the filter.
   
   Alternatively we could create a FilterBuilder that constructs filters using 
"and" and "or" methods to build an AbstractFileFilter and accept the builder as 
the argument for a 'setDirectoryFilter()' method.  Then passing NULL could set 
the internal value to org.apache.commons.io.filefilter.TrueFileFilter 
(accepting all directories).
   
   I think that creating a builder will make specifying options in ANT UI 
easier.  However, for now we can make due with adding a directoryFilter 
instance variable of type org.apache.commons.io.filefilter.AbstractFileFilter  
and setting it to ignore dot prefixed files by default.  Then your current 
method can simpley change that to 
org.apache.commons.io.filefilter.TrueFileFilter.  Later we can figure out how 
to specify more complex filters.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to