(Path file)
| 311 | } |
| 312 | |
| 313 | private static MappingFormat getFormat(Path file) { |
| 314 | if (Files.isDirectory(file)) return MappingFormat.ENIGMA_DIR; |
| 315 | |
| 316 | String name = file.getFileName().toString().toLowerCase(Locale.ENGLISH); |
| 317 | |
| 318 | for (MappingFormat format : MappingFormat.values()) { |
| 319 | if (format.hasSingleFile() |
| 320 | && name.endsWith(format.fileExt) |
| 321 | && name.length() > format.fileExt.length() |
| 322 | && name.charAt(name.length() - 1 - format.fileExt.length()) == '.') { |
| 323 | return format; |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | return null; |
| 328 | } |
| 329 | |
| 330 | private static MappingFormat getFormat(String selectedName) { |
| 331 | for (MappingFormat format : MappingFormat.values()) { |
no test coverage detected