diff --git a/ModuleSoundModem/pom.xml b/ModuleSoundModem/pom.xml index 391283567fe79a9af0b6201e4c8968bf3c496705..7bb0b40268e4eeae0161ac143dd133f6a45ff0a6 100644 --- a/ModuleSoundModem/pom.xml +++ b/ModuleSoundModem/pom.xml @@ -43,6 +43,38 @@ + + + + org.apache.maven.plugins + maven-assembly-plugin + + + + make-assembly + package + + single + + + + + + + + org.josast.ModuleSoundModem.SoundModemCli + + + + + jar-with-dependencies + + + + + + + diff --git a/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/SoundModemCli.java b/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/SoundModemCli.java index 426dacf3991d55b9c8f6a3ca13e4871177abf091..fc62b5777b37755045f96f5ee84fad4355251dc7 100644 --- a/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/SoundModemCli.java +++ b/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/SoundModemCli.java @@ -5,6 +5,7 @@ package org.josast.ModuleSoundModem; import java.io.IOException; import java.nio.file.Files; +import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; @@ -24,7 +25,10 @@ public class SoundModemCli { private static String version = "0.1"; private String configurationfile = "defaultConfigFile.ini"; - private String generateRepository = "SoundModemFile"; + /* + * Utilisation d'un répertoire par défaut + */ + private String generateRepository = "SoundModemOuput"; /** * @@ -122,6 +126,17 @@ public class SoundModemCli { // tant que connecté à SoundModem => reçoit des trames int cpt = 0; + Path path = Paths.get(generateRepository); + //if directory exists? + if (!Files.exists(path)) { + try { + Files.createDirectories(path); + } catch (IOException e) { + //fail to create directory + e.printStackTrace(); + } + } + while (true) { @@ -154,6 +169,8 @@ public class SoundModemCli { final CommandLine line = parser.parse(options, args); SoundModemCli smc = new SoundModemCli(); + + System.out.println(SoundModemCli.class.getSimpleName() + " " + version); // Si mode aide @@ -194,8 +211,7 @@ public class SoundModemCli { smc.setGenerateRepository(line.getOptionValue("Generate", "")); } - - System.out.println(SoundModemCli.class.getSimpleName() + " " + version); + smc.execute(); }