CAMEL-8241: Better stream closed check to ignore case. Thanks to Brian O'Keefe for the suggestion.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/18d7bfca Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/18d7bfca Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/18d7bfca Branch: refs/heads/camel-2.15.x Commit: 18d7bfca7634d393098801fa407b3b817580368a Parents: a7d2958 Author: Claus Ibsen <davscl...@apache.org> Authored: Fri Jul 31 11:50:35 2015 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Fri Jul 31 11:52:30 2015 +0200 ---------------------------------------------------------------------- .../camel/component/exec/impl/DefaultExecCommandExecutor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/18d7bfca/components/camel-exec/src/main/java/org/apache/camel/component/exec/impl/DefaultExecCommandExecutor.java ---------------------------------------------------------------------- diff --git a/components/camel-exec/src/main/java/org/apache/camel/component/exec/impl/DefaultExecCommandExecutor.java b/components/camel-exec/src/main/java/org/apache/camel/component/exec/impl/DefaultExecCommandExecutor.java index 9011231..b2ed60e 100644 --- a/components/camel-exec/src/main/java/org/apache/camel/component/exec/impl/DefaultExecCommandExecutor.java +++ b/components/camel-exec/src/main/java/org/apache/camel/component/exec/impl/DefaultExecCommandExecutor.java @@ -22,6 +22,7 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.List; +import java.util.Locale; import org.apache.camel.component.exec.ExecCommand; import org.apache.camel.component.exec.ExecCommandExecutor; @@ -79,7 +80,7 @@ public class DefaultExecCommandExecutor implements ExecCommandExecutor { } catch (IOException ioe) { // workaround to ignore if the stream was already closes due some race condition in commons-exec String msg = ioe.getMessage(); - if ("Stream closed".equals(msg)) { + if (msg != null && "stream closed".equals(msg.toLowerCase(Locale.ENGLISH))) { LOG.debug("Ignoring Stream closed IOException", ioe); // if the size is zero, we have no output, so construct the result // with null (required by ExecResult)