Author: echatellier Date: 2014-07-16 12:30:12 +0200 (Wed, 16 Jul 2014) New Revision: 395 Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/395 Log: Attente de la fin du process avant de lire le fichier de sortie Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java =================================================================== --- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java 2014-07-16 10:19:51 UTC (rev 394) +++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/job/MailFilterJob.java 2014-07-16 10:30:12 UTC (rev 395) @@ -616,7 +616,8 @@ log.debug("Convert attachment with command : " + comArgs); } try { - pb.start(); + Process process = pb.start(); + process.waitFor(); // read output to save into attachment byte[] outContent = FileUtils.readFileToByteArray(outfile); @@ -635,6 +636,10 @@ if (log.isErrorEnabled()) { log.error("Cannot run convert command", e); } + } catch (InterruptedException e) { + if (log.isErrorEnabled()) { + log.error("Cannot run convert command", e); + } } // cleanup