From aa51770d8bf44790696eede4229f74521c13b884 Mon Sep 17 00:00:00 2001 From: Ruslan Forostianov Date: Wed, 11 Nov 2015 15:16:52 +0100 Subject: [PATCH] Read error message only once. Fix java.io.IOException: Stream closed --- grails-app/controllers/ImportXnatController.groovy | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/grails-app/controllers/ImportXnatController.groovy b/grails-app/controllers/ImportXnatController.groovy index c1a72c5..52c7f21 100644 --- a/grails-app/controllers/ImportXnatController.groovy +++ b/grails-app/controllers/ImportXnatController.groovy @@ -178,11 +178,13 @@ class ImportXnatController { def process = ("python " + getScriptsLocation() + "/xnattotransmartlink/downloadscript.py ${url} ${username} ${password} ${project} ${node} ${kettledir} ${datadir}").execute(null, new File(getScriptsLocation() + "/xnattotransmartlink")) process.waitFor() - if (process.err.text == "") { - flash.message = "${process.in.text}" + def inText = process.in.text + def errText = process.err.text + if (errText) { + flash.message = "${errText}
${inText}" } else { - flash.message = "${process.err.text}
${process.in.text}" - } + flash.message = inText + } redirect action: import_wizard, id: importXnatConfiguration.id }