commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1101138 - /commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/WindowsExec.java
Date Mon, 09 May 2011 18:34:35 GMT
Author: mturk
Date: Mon May  9 18:34:35 2011
New Revision: 1101138

URL: http://svn.apache.org/viewvc?rev=1101138&view=rev
Log:
Replace output with input stream for exec

Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/WindowsExec.java

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/WindowsExec.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/WindowsExec.java?rev=1101138&r1=1101137&r2=1101138&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/WindowsExec.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/WindowsExec.java
Mon May  9 18:34:35 2011
@@ -22,9 +22,9 @@ import org.apache.commons.runtime.Status
 import org.apache.commons.runtime.InvalidArgumentException;
 import org.apache.commons.runtime.SystemException;
 import org.apache.commons.runtime.util.Utils;
-import java.io.ByteArrayOutputStream;
+import java.io.ByteArrayInputStream;
 import java.io.CharArrayWriter;
-import java.io.OutputStream;
+import java.io.InputStream;
 import java.io.File;
 import java.util.List;
 import java.util.Vector;
@@ -48,9 +48,10 @@ final class WindowsExec extends Exec
                                     char[] envb,
                                     String cwd,
                                     byte[] inp,
-                                    ByteArrayOutputStream out,
-                                    ByteArrayOutputStream err,
+                                    ByteArrayInputStream[] out,
+                                    int redir,
                                     int timeout);
+
     @Override
     public int run(List<String> argv, int timeout)
     {
@@ -84,10 +85,13 @@ final class WindowsExec extends Exec
         if (executable == null) {
             return Status.PARENT_ERROR;
         }
+        ByteArrayInputStream[] isa = new ByteArrayInputStream[2];
         char[] eb = Utils.stringArrayToCharBlock(env);
-        long rv = run0(executable, args.toString(), eb, cwd, inp, out, err, timeout);
+        long rv = run0(executable, args.toString(), eb, cwd, inp, isa, redirect, timeout);
         exitval = (int)(rv & 0xffffffffL);
         int res = (int)(rv >>> 32);
+        out     = isa[0];
+        err     = isa[1];
 
         return res;
     }



Mime
View raw message