Skip to contentSkip to conversation

Adapt OutputProcessor to retrieve reader from shell

PATCH New Ioana Grigoropol 1 participant 1 message Jun 13, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Adapt OutputProcessor to retrieve reader from shell

- adapt code to use IHostShell interface modifyied locally in order to retrieve the same underlying error and output stream

---
 .../org/yocto/remote/utils/OutputProcessor.java    |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/OutputProcessor.java +2 -8
index 401a782..04c04e1 100644
@@ -49,14 +49,8 @@ public abstract class OutputProcessor{
 		BufferedReader inbr = null;
 		BufferedReader errbr = null;
 
-		if (hostShell instanceof LocalHostShell) {
-			inbr = ((LocalHostShell)hostShell).getReader(false);
-			errbr = ((LocalHostShell)hostShell).getReader(true);
-		} else {
-			Process p = new HostShellProcessAdapter(hostShell);
-			inbr = new BufferedReader(new InputStreamReader(p.getInputStream()));
-			errbr = new BufferedReader(new InputStreamReader(p.getErrorStream()));
-		}
+		inbr = hostShell.getReader(false);
+		errbr = hostShell.getReader(true);
 		boolean cancel = false;
 		while (!cancel) {
 			if(monitor.isCanceled()) {
Signature · 1 line
1.7.9.5