* @param directory
   * @param input
   * @param output
   * @param error
   * @return int
   */
  public static int executeShellCommand(Stella_Object command, String directory, InputStream input, OutputStream output, OutputStream error) {
    { ShellProcess self000 = ShellProcess.newShellProcess();

      self000.command = OntosaurusUtil.parseShellCommand(command);
      self000.directory = ((directory != null) ? directory : ".");
      self000.inputStream = input;
      self000.outputStream = output;
      self000.errorStream = error;
      { ShellProcess process = self000;

        process.startProcess();
        { Thread outputthread = ((output != null) ? Thread.newThread(Native.find_java_method("edu.isi.stella.InputStream", "copyStreamToStream", new java.lang.Class [] {Native.find_java_class("edu.isi.stella.InputStream"), Native.find_java_class("edu.isi.stella.OutputStream")}), Stella.vector(Cons.cons(process.nativeStdout, Cons.cons(process.outputStream, Stella.NIL)))) : ((Thread)(null)));
          Thread errorthread = ((error != null) ? Thread.newThread(Native.find_java_method("edu.isi.stella.InputStream", "copyStreamToStream", new java.lang.Class [] {Native.find_java_class("edu.isi.stella.InputStream"), Native.find_java_class("edu.isi.stella.OutputStream")}), Stella.vector(Cons.cons(process.nativeStderr, Cons.cons(process.errorStream, Stella.NIL)))) : ((Thread)(null)));

          if (outputthread != null) {
            outputthread.startThread();
          }
          if (errorthread != null) {
            errorthread.startThread();
          }
          if (input != null) {
            InputStream.copyStreamToStream(input, process.nativeStdin);
            Stream.closeStream(process.nativeStdin);
          }
          if (outputthread != null) {
            outputthread.waitForCompletion();
          }
          if (errorthread != null) {
            errorthread.waitForCompletion();
          }
          process.waitForCompletion();
          process.destroyProcess();
          return (process.exitStatus);
        }
      }
    }
  }