diff options
Diffstat (limited to 'src/main/java/cuchaz/enigma/command/Command.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/command/Command.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/cuchaz/enigma/command/Command.java b/src/main/java/cuchaz/enigma/command/Command.java index d53ed6e..09dd321 100644 --- a/src/main/java/cuchaz/enigma/command/Command.java +++ b/src/main/java/cuchaz/enigma/command/Command.java | |||
| @@ -13,6 +13,8 @@ import java.nio.file.Files; | |||
| 13 | import java.nio.file.Path; | 13 | import java.nio.file.Path; |
| 14 | import java.nio.file.Paths; | 14 | import java.nio.file.Paths; |
| 15 | 15 | ||
| 16 | import com.google.common.io.MoreFiles; | ||
| 17 | |||
| 16 | public abstract class Command { | 18 | public abstract class Command { |
| 17 | public final String name; | 19 | public final String name; |
| 18 | 20 | ||
| @@ -49,6 +51,8 @@ public abstract class Command { | |||
| 49 | protected static MappingFormat chooseEnigmaFormat(Path path) { | 51 | protected static MappingFormat chooseEnigmaFormat(Path path) { |
| 50 | if (Files.isDirectory(path)) { | 52 | if (Files.isDirectory(path)) { |
| 51 | return MappingFormat.ENIGMA_DIRECTORY; | 53 | return MappingFormat.ENIGMA_DIRECTORY; |
| 54 | } else if ("zip".equalsIgnoreCase(MoreFiles.getFileExtension(path))) { | ||
| 55 | return MappingFormat.ENIGMA_ZIP; | ||
| 52 | } else { | 56 | } else { |
| 53 | return MappingFormat.ENIGMA_FILE; | 57 | return MappingFormat.ENIGMA_FILE; |
| 54 | } | 58 | } |