Files#walk(), find(), list(), DirectoryStream

Files.walk()は該当ディレクトリのサブディレクトリすべてを探索
Files.find()は該当ディレクトリのサブディレクトリすべてを探索、BiPredicateのフィルタ付き
Files.list()は該当ディレクトリの一覧
Files.newDirectoryStream()は該当ディレクトリの一覧

```java
public class Outer {
    public static void main(String[] args) throws Exception{
        Path p = Paths.get("C:\\dirtest");
        BiPredicate<Path,BasicFileAttributes> bp = (p1,bfa) -> {
            return p1.toFile().getAbsolutePath().endsWith(".java");
        };
        Stream<Path> s = Files.find(p,3,bp);
        s.forEach(System.out::println);
        System.out.println("----------------------------------------------");
        s = Files.walk(p,3);
        s.forEach(System.out::println);
        method2(p.toFile());
        System.out.println("----------------------------------------------");
        DirectoryStream<Path> ds = Files.newDirectoryStream(p);
        for(Path p2:ds) {
            System.out.println(p2);
        }
        System.out.println("----------------------------------------------");
        Files.list(p).forEach(System.out::println);
    }
    static void method2(File pf) {
        System.out.println("----------------------------------------------");
        method(pf, "", null);
    }
    static void method(File pf, String indent, FileFilter ff) {
        class SampleClass {
            File[]  method() {
                if(ff == null) return pf.listFiles();
                else  return pf.listFiles(ff);
            }
        }
        File[] fs = new SampleClass().method();
        for(File f:fs) {
            System.out.print(indent + f.getName());
            if(f.isDirectory())  System.out.println("   is directory.");
            else  System.out.println("    is file");
            if(f.isDirectory())  method(f, indent + " ",ff);
        }
    }
}
```
```
C:\dirtest\dir1\dir2\test.java
C:\dirtest\dir1\test.java
C:\dirtest\test.java
----------------------------------------------
C:\dirtest
C:\dirtest\cook.jpg
C:\dirtest\cookcpy.jpg
C:\dirtest\dir1
C:\dirtest\dir1\dir2
C:\dirtest\dir1\dir2\dir3
C:\dirtest\dir1\dir2\test.java
C:\dirtest\dir1\dir2\test.txt
C:\dirtest\dir1\test.java
C:\dirtest\dir1\test.txt
C:\dirtest\iii
C:\dirtest\sample.ser
C:\dirtest\showa.txt
C:\dirtest\test.java
C:\dirtest\test.txt
C:\dirtest\testmakefile.txt
C:\dirtest\testwritefile.txt
----------------------------------------------
cook.jpg    is file
cookcpy.jpg    is file
dir1   is directory.
 dir2   is directory.
  dir3   is directory.
   dir4   is directory.
    test.java    is file
    test.txt    is file
   test.java    is file
   test.txt    is file
  test.java    is file
  test.txt    is file
 test.java    is file
 test.txt    is file
iii    is file
sample.ser    is file
showa.txt    is file
test.java    is file
test.txt    is file
testmakefile.txt    is file
testwritefile.txt    is file
----------------------------------------------
C:\dirtest\cook.jpg
C:\dirtest\cookcpy.jpg
C:\dirtest\dir1
C:\dirtest\iii
C:\dirtest\sample.ser
C:\dirtest\showa.txt
C:\dirtest\test.java
C:\dirtest\test.txt
C:\dirtest\testmakefile.txt
C:\dirtest\testwritefile.txt
----------------------------------------------
C:\dirtest\cook.jpg
C:\dirtest\cookcpy.jpg
C:\dirtest\dir1
C:\dirtest\iii
C:\dirtest\sample.ser
C:\dirtest\showa.txt
C:\dirtest\test.java
C:\dirtest\test.txt
C:\dirtest\testmakefile.txt
C:\dirtest\testwritefile.txt
```