(Path dir)
| 302 | } |
| 303 | |
| 304 | private static boolean isDirEmpty(Path dir) { |
| 305 | try (Stream<Path> stream = Files.list(dir)) { |
| 306 | return !stream.anyMatch(ignore -> true); |
| 307 | } catch (IOException e) { |
| 308 | e.printStackTrace(); |
| 309 | return false; |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | private static MappingFormat getFormat(Path file) { |
| 314 | if (Files.isDirectory(file)) return MappingFormat.ENIGMA_DIR; |