home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / java / lang / Win32Process.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  2.5 KB  |  121 lines

  1. package java.lang;
  2.  
  3. import java.io.FileDescriptor;
  4. import java.io.InputStream;
  5. import java.io.OutputStream;
  6. import java.security.AccessController;
  7.  
  8. class Win32Process extends Process {
  9.    private int handle;
  10.    private FileDescriptor stdin_fd;
  11.    private FileDescriptor stdout_fd;
  12.    private FileDescriptor stderr_fd;
  13.    private OutputStream stdin_stream;
  14.    private InputStream stdout_stream;
  15.    private InputStream stderr_stream;
  16.  
  17.    Win32Process(String[] var1, String[] var2) throws Exception {
  18.       this(var1, var2, (String)null);
  19.    }
  20.  
  21.    Win32Process(String[] var1, String[] var2, String var3) throws Exception {
  22.       this.handle = 0;
  23.       StringBuffer var4 = new StringBuffer(80);
  24.  
  25.       for(int var5 = 0; var5 < var1.length; ++var5) {
  26.          if (var5 > 0) {
  27.             var4.append(' ');
  28.          }
  29.  
  30.          String var6 = var1[var5];
  31.          if (var6.indexOf(32) < 0 && var6.indexOf(9) < 0) {
  32.             var4.append(var6);
  33.          } else if (var6.charAt(0) != '"') {
  34.             var4.append('"');
  35.             var4.append(var6);
  36.             var4.append('"');
  37.          } else {
  38.             if (!var6.endsWith("\"")) {
  39.                throw new IllegalArgumentException();
  40.             }
  41.  
  42.             var4.append(var6);
  43.          }
  44.       }
  45.  
  46.       String var10 = var4.toString();
  47.       String var7 = null;
  48.       if (var2 != null) {
  49.          StringBuffer var8 = new StringBuffer(256);
  50.  
  51.          for(int var9 = 0; var9 < var2.length; ++var9) {
  52.             var8.append(var2[var9]).append('\u0000');
  53.          }
  54.  
  55.          var7 = var8.toString();
  56.       }
  57.  
  58.       this.stdin_fd = new FileDescriptor();
  59.       this.stdout_fd = new FileDescriptor();
  60.       this.stderr_fd = new FileDescriptor();
  61.       this.handle = this.create(var10, var7, var3, this.stdin_fd, this.stdout_fd, this.stderr_fd);
  62.       AccessController.doPrivileged(new 1(this));
  63.    }
  64.  
  65.    public OutputStream getOutputStream() {
  66.       return this.stdin_stream;
  67.    }
  68.  
  69.    public InputStream getInputStream() {
  70.       return this.stdout_stream;
  71.    }
  72.  
  73.    public InputStream getErrorStream() {
  74.       return this.stderr_stream;
  75.    }
  76.  
  77.    public void finalize() {
  78.       this.close();
  79.    }
  80.  
  81.    public native int exitValue();
  82.  
  83.    public native int waitFor();
  84.  
  85.    public native void destroy();
  86.  
  87.    private native int create(String var1, String var2, String var3, FileDescriptor var4, FileDescriptor var5, FileDescriptor var6);
  88.  
  89.    private native void close();
  90.  
  91.    // $FF: synthetic method
  92.    static OutputStream access$002(Win32Process var0, OutputStream var1) {
  93.       return var0.stdin_stream = var1;
  94.    }
  95.  
  96.    // $FF: synthetic method
  97.    static FileDescriptor access$100(Win32Process var0) {
  98.       return var0.stdin_fd;
  99.    }
  100.  
  101.    // $FF: synthetic method
  102.    static InputStream access$202(Win32Process var0, InputStream var1) {
  103.       return var0.stdout_stream = var1;
  104.    }
  105.  
  106.    // $FF: synthetic method
  107.    static FileDescriptor access$300(Win32Process var0) {
  108.       return var0.stdout_fd;
  109.    }
  110.  
  111.    // $FF: synthetic method
  112.    static InputStream access$402(Win32Process var0, InputStream var1) {
  113.       return var0.stderr_stream = var1;
  114.    }
  115.  
  116.    // $FF: synthetic method
  117.    static FileDescriptor access$500(Win32Process var0) {
  118.       return var0.stderr_fd;
  119.    }
  120. }
  121.