home *** CD-ROM | disk | FTP | other *** search
- package java.lang;
-
- import java.io.File;
- import java.io.FileDescriptor;
- import java.io.IOException;
- import java.io.InputStream;
- import java.io.OutputStream;
- import java.security.AccessController;
- import java.util.Map;
-
- final class ProcessImpl extends Process {
- private long handle = 0L;
- private FileDescriptor stdin_fd;
- private FileDescriptor stdout_fd;
- private FileDescriptor stderr_fd;
- private OutputStream stdin_stream;
- private InputStream stdout_stream;
- private InputStream stderr_stream;
-
- static Process start(String[] var0, Map<String, String> var1, String var2, boolean var3) throws IOException {
- String var4 = ProcessEnvironment.toEnvironmentBlock(var1);
- return new ProcessImpl(var0, var4, var2, var3);
- }
-
- private ProcessImpl(String[] var1, String var2, String var3, boolean var4) throws IOException {
- var1[0] = (new File(var1[0])).getPath();
- StringBuilder var5 = new StringBuilder(80);
-
- for(int var6 = 0; var6 < var1.length; ++var6) {
- if (var6 > 0) {
- var5.append(' ');
- }
-
- String var7 = var1[var6];
- if (var7.indexOf(32) < 0 && var7.indexOf(9) < 0) {
- var5.append(var7);
- } else if (var7.charAt(0) != '"') {
- var5.append('"');
- var5.append(var7);
- if (var7.endsWith("\\")) {
- var5.append("\\");
- }
-
- var5.append('"');
- } else {
- if (!var7.endsWith("\"")) {
- throw new IllegalArgumentException();
- }
-
- var5.append(var7);
- }
- }
-
- String var8 = var5.toString();
- this.stdin_fd = new FileDescriptor();
- this.stdout_fd = new FileDescriptor();
- this.stderr_fd = new FileDescriptor();
- this.handle = this.create(var8, var2, var3, var4, 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 long create(String var1, String var2, String var3, boolean var4, FileDescriptor var5, FileDescriptor var6, FileDescriptor var7) throws IOException;
-
- private native void close();
-
- // $FF: synthetic method
- static OutputStream access$002(ProcessImpl var0, OutputStream var1) {
- return var0.stdin_stream = var1;
- }
-
- // $FF: synthetic method
- static FileDescriptor access$100(ProcessImpl var0) {
- return var0.stdin_fd;
- }
-
- // $FF: synthetic method
- static InputStream access$202(ProcessImpl var0, InputStream var1) {
- return var0.stdout_stream = var1;
- }
-
- // $FF: synthetic method
- static FileDescriptor access$300(ProcessImpl var0) {
- return var0.stdout_fd;
- }
-
- // $FF: synthetic method
- static InputStream access$402(ProcessImpl var0, InputStream var1) {
- return var0.stderr_stream = var1;
- }
-
- // $FF: synthetic method
- static FileDescriptor access$500(ProcessImpl var0) {
- return var0.stderr_fd;
- }
- }
-