no need to check this exception anymore
@@ -4,6 +4,7 @@ import com.quorum.tessera.config.*;
import com.quorum.tessera.config.keys.KeyGenerator;
import com.quorum.tessera.config.keys.KeyGeneratorFactory;
import com.quorum.tessera.config.util.JaxbUtil;
+
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
@@ -13,9 +14,11 @@ import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
+
import static java.nio.file.StandardOpenOption.CREATE;
import static java.nio.file.StandardOpenOption.CREATE_NEW;
import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -113,7 +116,6 @@ public class DefaultCliAdapter implements CliAdapter {
final CommandLineParser parser = new DefaultParser();
- try {
final CommandLine line = parser.parse(options, args);
@@ -130,17 +132,12 @@ public class DefaultCliAdapter implements CliAdapter {
});
-
if (line.hasOption("pidfile")) {
createPidFile(line);
}
return new CliResult(0, false, config);
- } catch (ParseException exp) {
- throw new CliException(exp.getMessage());
- }
-
}
private Config parseConfig(CommandLine commandLine) throws IOException {
@@ -178,8 +175,7 @@ public class DefaultCliAdapter implements CliAdapter {
//we have generated new keys, so we need to output the new configuration
output(commandLine, config);
}
- }
- else {
+ } else {
final KeyGenerator generator = KeyGeneratorFactory.create();
keyGenConfigs.stream()
.map(kcd -> JaxbUtil.unmarshal(kcd, KeyDataConfig.class))
