1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
/** Appel de l'injecteur */
try{
Runtime run=Runtime.getRuntime(); //initialisation du runtime
String commande="/usr/local/apache-ant-1.7.0/bin/ant -buildfile /users/injecteur/build.xml -Dficxml="+InterfaceEnvoi.fichierEnregistre+" -Dclef="+InterfaceEnvoi.clefCryptage+" -Durl="+InterfaceEnvoi.url+" -Dcode="+ficRep+" run-inj";
String[] argument = { "/bin/bash", "-c", commande };
Process process=run.exec(argument); //execution du script lancant l injecteur
try{ //affichage du flux de sortie
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String ligne = null;
try{
System.out.println(ligne);
}finally{reader.close();}
}catch(IOException ioe){ }
process.waitFor();
}catch(Exception e){
System.exit(2);
} |