62,614
社区成员
发帖
与我相关
我的任务
分享
try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, "ab*")) {
for (Path entry: stream) {
System.out.println(entry);
}
} catch (DirectoryIteratorException ex) {
// I/O error encounted during the iteration, the cause is an IOException
throw ex.getCause();
}