From bfd7bfd739968af5b7bad17134783deedd424f1f Mon Sep 17 00:00:00 2001 From: Chocohead Date: Tue, 17 Mar 2020 23:28:47 +0000 Subject: 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--- src/main/java/cuchaz/enigma/Main.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/main/java/cuchaz/enigma/Main.java') 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; import java.nio.file.Path; import java.nio.file.Paths; +import com.google.common.io.MoreFiles; + public class Main { public static void main(String[] args) throws IOException { @@ -78,6 +80,8 @@ public class Main { Path mappingsPath = options.valueOf(mappings); if (Files.isDirectory(mappingsPath)) { controller.openMappings(MappingFormat.ENIGMA_DIRECTORY, mappingsPath); + } else if ("zip".equalsIgnoreCase(MoreFiles.getFileExtension(mappingsPath))) { + controller.openMappings(MappingFormat.ENIGMA_ZIP, mappingsPath); } else { controller.openMappings(MappingFormat.ENIGMA_FILE, mappingsPath); } -- cgit v1.2.3