void (@NotNull Path dir, @NotNull Object2LongMap<String> result) { try (DirectoryStream<Path> children = Files.newDirectoryStream(dir)) { for (Path child : children) { String childPath = child.toString(); if (!childPath.endsWith(".xml") || child.getFileName().toString().startsWith(".")) { continue; } BasicFileAttributes attributes; try { attributes = Files.readAttributes(child, BasicFileAttributes.class); if (attributes.isDirectory()) { continue; } } catch (IOException ignore) { continue; } result.put(childPath, attributes.lastModifiedTime().to(TimeUnit.SECONDS)); } } catch (NotDirectoryException | NoSuchFileException ignore) { } catch (IOException e) { LOG.warn(e); } }