For those also interested in Java 7 and NIO, there is an alternative solution to @ voo’s answer above. We can use a 尝试使用资源 that calls Files.find() and a lambda function that is used to filter the directories.
final long now = System.currentTimeMillis();
final long yesterday = new Date(now - 24 * 60 * 60 * 1000L).getTime();
// modified in the last 24 hours
(path, attributes) -> attributes.isDirectory() && attributes.lastModifiedTime().toMillis() > yesterday
File files = new File("src");
// src is folder name...
//This will return the list of the subDirectories
List<File> subDirectories = Arrays.stream(files.listFiles()).filter(File::isDirectory).collect(Collectors.toList());
// this will print all the sub directories
Arrays.stream(files.listFiles()).filter(File::isDirectory).forEach(System.out::println);