@Test
	public void testDir() {
		Path dir = Paths.get("F:\\\\tmp");
		
		//这个只能列出当前目录下符合的文件
		try (DirectoryStream<Path> stream = 
				Files.newDirectoryStream(dir, "*.txt")) {
			System.out.println("=========DirectoryStream start=========");
			for (Path path : stream) {
				System.out.println(path);
			}
			System.out.println("=========DirectoryStream end=========");
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		//这个将递归列出所有符合的文件
		try {
			System.out.println("=========walkFileTree start=========");
			Files.walkFileTree(dir, new SimpleFileVisitor<Path>() {
				@Override
			    public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) {
					if (path.toString().endsWith(".txt")) {
						System.out.println(path);
					}
					return FileVisitResult.CONTINUE;
				}
			});
			System.out.println("=========walkFileTree end=========");
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	}