diff options
Diffstat (limited to 'src/main/java/cuchaz/enigma/command/ConvertMappingsCommand.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/command/ConvertMappingsCommand.java | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/main/java/cuchaz/enigma/command/ConvertMappingsCommand.java b/src/main/java/cuchaz/enigma/command/ConvertMappingsCommand.java deleted file mode 100644 index 689df02..0000000 --- a/src/main/java/cuchaz/enigma/command/ConvertMappingsCommand.java +++ /dev/null | |||
| @@ -1,39 +0,0 @@ | |||
| 1 | package cuchaz.enigma.command; | ||
| 2 | |||
| 3 | import cuchaz.enigma.throwables.MappingParseException; | ||
| 4 | import cuchaz.enigma.translation.mapping.EntryMapping; | ||
| 5 | import cuchaz.enigma.translation.mapping.MappingFileNameFormat; | ||
| 6 | import cuchaz.enigma.translation.mapping.MappingSaveParameters; | ||
| 7 | import cuchaz.enigma.translation.mapping.tree.EntryTree; | ||
| 8 | import cuchaz.enigma.utils.Utils; | ||
| 9 | |||
| 10 | import java.io.IOException; | ||
| 11 | import java.nio.file.Path; | ||
| 12 | import java.nio.file.Paths; | ||
| 13 | |||
| 14 | public class ConvertMappingsCommand extends Command { | ||
| 15 | public ConvertMappingsCommand() { | ||
| 16 | super("convert-mappings"); | ||
| 17 | } | ||
| 18 | |||
| 19 | @Override | ||
| 20 | public String getUsage() { | ||
| 21 | return "<source-format> <source> <result-format> <result>"; | ||
| 22 | } | ||
| 23 | |||
| 24 | @Override | ||
| 25 | public boolean isValidArgument(int length) { | ||
| 26 | return length == 4; | ||
| 27 | } | ||
| 28 | |||
| 29 | @Override | ||
| 30 | public void run(String... args) throws IOException, MappingParseException { | ||
| 31 | MappingSaveParameters saveParameters = new MappingSaveParameters(MappingFileNameFormat.BY_DEOBF); | ||
| 32 | |||
| 33 | EntryTree<EntryMapping> mappings = MappingCommandsUtil.read(args[0], Paths.get(args[1]), saveParameters); | ||
| 34 | |||
| 35 | Path output = Paths.get(args[3]); | ||
| 36 | Utils.delete(output); | ||
| 37 | MappingCommandsUtil.write(mappings, args[2], output, saveParameters); | ||
| 38 | } | ||
| 39 | } | ||