690 shaares
3 liens privés
3 liens privés
Path dir = Paths.get(String dirname);
// try with resources
try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, "*.xml")) {
if (stream != null) {
for (Path file : stream) {
BasicFileAttributes attrs = Files.readAttributes(path, BasicFileAttributes.class);
}
}
}