public static void collectPaths ( Path path , FileSystem fs , PathFilter filter , final List < Path > accumulator ) throws IOException { walkPath ( path , fs , filter , new PathVisitor ( ) { @ Override public void visit ( FileStatus fileStatus ) { accumulator . add ( fileStatus . getPath ( ) ) ; } } ) ; }
Recursively walk a path adding paths that are accepted by filter to accumulator