summaryrefslogtreecommitdiff
path: root/src/main/java/cuchaz/enigma/Main.java
diff options
context:
space:
mode:
authorGravatar Chocohead2020-03-17 23:28:47 +0000
committerGravatar GitHub2020-03-17 23:28:47 +0000
commitbfd7bfd739968af5b7bad17134783deedd424f1f (patch)
treea9dc7906c88c1c8c40c98f0f97632cd7dd269e25 /src/main/java/cuchaz/enigma/Main.java
parentFix documenting constructors (#201) (diff)
downloadenigma-fork-bfd7bfd739968af5b7bad17134783deedd424f1f.tar.gz
enigma-fork-bfd7bfd739968af5b7bad17134783deedd424f1f.tar.xz
enigma-fork-bfd7bfd739968af5b7bad17134783deedd424f1f.zip
Add support for reading/writing zipped mappings (#199)
* Add support to read/write Enigma mappings from ZIP Takes any path which points to a ZIP as wanting to be read/written as a ZIP Paths from an existing ZIP file system will be correctly handled as directories * Fix deleting a path needing to be from the default file system * Allow calling MapSpecializedMethodsCommand directly * Fix indentation * Missing static
Diffstat (limited to 'src/main/java/cuchaz/enigma/Main.java')
-rw-r--r--src/main/java/cuchaz/enigma/Main.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/cuchaz/enigma/Main.java b/src/main/java/cuchaz/enigma/Main.java
index ceb5554..1d63ec1 100644
--- a/src/main/java/cuchaz/enigma/Main.java
+++ b/src/main/java/cuchaz/enigma/Main.java
@@ -25,6 +25,8 @@ import java.nio.file.Files;
25import java.nio.file.Path; 25import java.nio.file.Path;
26import java.nio.file.Paths; 26import java.nio.file.Paths;
27 27
28import com.google.common.io.MoreFiles;
29
28public class Main { 30public class Main {
29 31
30 public static void main(String[] args) throws IOException { 32 public static void main(String[] args) throws IOException {
@@ -78,6 +80,8 @@ public class Main {
78 Path mappingsPath = options.valueOf(mappings); 80 Path mappingsPath = options.valueOf(mappings);
79 if (Files.isDirectory(mappingsPath)) { 81 if (Files.isDirectory(mappingsPath)) {
80 controller.openMappings(MappingFormat.ENIGMA_DIRECTORY, mappingsPath); 82 controller.openMappings(MappingFormat.ENIGMA_DIRECTORY, mappingsPath);
83 } else if ("zip".equalsIgnoreCase(MoreFiles.getFileExtension(mappingsPath))) {
84 controller.openMappings(MappingFormat.ENIGMA_ZIP, mappingsPath);
81 } else { 85 } else {
82 controller.openMappings(MappingFormat.ENIGMA_FILE, mappingsPath); 86 controller.openMappings(MappingFormat.ENIGMA_FILE, mappingsPath);
83 } 87 }