home *** CD-ROM | disk | FTP | other *** search
- package java.lang;
-
- import java.io.FileDescriptor;
- import java.io.InputStream;
- import java.io.OutputStream;
- import java.security.AccessController;
-
- class Win32Process extends Process {
- private int handle;
- private FileDescriptor stdin_fd;
- private FileDescriptor stdout_fd;
- private FileDescriptor stderr_fd;
- private OutputStream stdin_stream;
- private InputStream stdout_stream;
- private InputStream stderr_stream;
-
- Win32Process(String[] var1, String[] var2) throws Exception {
- this(var1, var2, (String)null);
- }
-
- Win32Process(String[] var1, String[] var2, String var3) throws Exception {
- this.handle = 0;
- StringBuffer var4 = new StringBuffer(80);
-
- for(int var5 = 0; var5 < var1.length; ++var5) {
- if (var5 > 0) {
- var4.append(' ');
- }
-
- String var6 = var1[var5];
- if (var6.indexOf(32) < 0 && var6.indexOf(9) < 0) {
- var4.append(var6);
- } else if (var6.charAt(0) != '"') {
- var4.append('"');
- var4.append(var6);
- var4.append('"');
- } else {
- if (!var6.endsWith("\"")) {
- throw new IllegalArgumentException();
- }
-
- var4.append(var6);
- }
- }
-
- String var10 = var4.toString();
- String var7 = null;
- if (var2 != null) {
- StringBuffer var8 = new StringBuffer(256);
-
- for(int var9 = 0; var9 < var2.length; ++var9) {
- var8.append(var2[var9]).append('\u0000');
- }
-
- var7 = var8.toString();
- }
-
- this.stdin_fd = new FileDescriptor();
- this.stdout_fd = new FileDescriptor();
- this.stderr_fd = new FileDescriptor();
- this.handle = this.create(var10, var7, var3, this.stdin_fd, this.stdout_fd, this.stderr_fd);
- AccessController.doPrivileged(new 1(this));
- }
-
- public OutputStream getOutputStream() {
- return this.stdin_stream;
- }
-
- public InputStream getInputStream() {
- return this.stdout_stream;
- }
-
- public InputStream getErrorStream() {
- return this.stderr_stream;
- }
-
- public void finalize() {
- this.close();
- }
-
- public native int exitValue();
-
- public native int waitFor();
-
- public native void destroy();
-
- private native int create(String var1, String var2, String var3, FileDescriptor var4, FileDescriptor var5, FileDescriptor var6);
-
- private native void close();
-
- // $FF: synthetic method
- static OutputStream access$002(Win32Process var0, OutputStream var1) {
- return var0.stdin_stream = var1;
- }
-
- // $FF: synthetic method
- static FileDescriptor access$100(Win32Process var0) {
- return var0.stdin_fd;
- }
-
- // $FF: synthetic method
- static InputStream access$202(Win32Process var0, InputStream var1) {
- return var0.stdout_stream = var1;
- }
-
- // $FF: synthetic method
- static FileDescriptor access$300(Win32Process var0) {
- return var0.stdout_fd;
- }
-
- // $FF: synthetic method
- static InputStream access$402(Win32Process var0, InputStream var1) {
- return var0.stderr_stream = var1;
- }
-
- // $FF: synthetic method
- static FileDescriptor access$500(Win32Process var0) {
- return var0.stderr_fd;
- }
- }
-