// Path: src/alda/error/AlreadyUpException.java
// public class AlreadyUpException extends AldaException {
// 
//   public AlreadyUpException(String msg) {
//     super(msg);
//   }
// 
//   @Override
//   public ExitCode getExitCode() { return ExitCode.USER_ERROR; }
// 
// }
// 
// Path: src/alda/error/InvalidOptionsException.java
// public class InvalidOptionsException extends AldaException {
// 
//   public InvalidOptionsException(String msg) {
//     super(msg);
//   }
// 
//   @Override
//   public ExitCode getExitCode() { return ExitCode.USER_ERROR; }
// 
// }
// 
// Path: src/alda/error/NoAvailableWorkerException.java
// public class NoAvailableWorkerException extends AldaException {
// 
//   public NoAvailableWorkerException(String msg) {
//     super(msg);
//   }
// 
//   @Override
//   public ExitCode getExitCode() { return ExitCode.RUNTIME_ERROR; }
// 
// }
// 
// Path: src/alda/error/NoResponseException.java
// public class NoResponseException extends AldaException {
// 
//   public NoResponseException(String msg) {
//     super(msg);
//   }
// 
//   @Override
//   public ExitCode getExitCode() { return ExitCode.NETWORK_ERROR; }
// 
// }
// 
// Path: src/alda/error/ParseError.java
// public class ParseError extends AldaException {
// 
//   public ParseError(String msg) {
//     super(msg);
//   }
// 
//   @Override
//   public ExitCode getExitCode() { return ExitCode.USER_ERROR; }
// 
// }
// 
// Path: src/alda/error/SystemException.java
// public class SystemException extends AldaException {
//   public SystemException(String msg) {
//     super(msg);
//   }
// 
//   public SystemException(String msg, Throwable e) {
//     super(msg, e);
//   }
// 
//   @Override
//   public ExitCode getExitCode() { return ExitCode.SYSTEM_ERROR; }
// 
// }
// 
// Path: src/alda/error/UnsuccessfulException.java
// public class UnsuccessfulException extends AldaException {
// 
//   public UnsuccessfulException(String msg) {
//     super(msg);
//   }
// 
//   @Override
//   public ExitCode getExitCode() { return ExitCode.UNSPECIFIED_ERROR; }
// 
// }


import alda.error.AlreadyUpException;
import alda.error.InvalidOptionsException;
import alda.error.NoAvailableWorkerException;
import alda.error.NoResponseException;
import alda.error.ParseError;
import alda.error.SystemException;
import alda.error.UnsuccessfulException;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.UUID;
import org.apache.commons.lang3.SystemUtils;
import org.fusesource.jansi.AnsiConsole;
import static org.fusesource.jansi.Ansi.*;
import static org.fusesource.jansi.Ansi.Color.*;
  }

  private void announceServerDown(boolean isGood) {
    Color color = isGood ? GREEN : RED;
    String glyph = isGood ? CHECKMARK : X;
    if (noColor) {
      msg("Server down " + glyph);
    } else {
      msg(ansi().a("Server down ").fg(color).a(glyph).reset().toString());
    }
  }

  private void announceServerDown() {
    announceServerDown(false);
  }

  public void upBg(int numberOfWorkers)
    throws InvalidOptionsException, NoResponseException, AlreadyUpException,
           SystemException {
    assertNotRemoteHost();

    boolean serverAlreadyUp = checkForConnection();
    if (serverAlreadyUp) {
      throw new AlreadyUpException("Server already up.");
    }

    boolean serverAlreadyTryingToStart;
    try {
      serverAlreadyTryingToStart = SystemUtils.IS_OS_UNIX &&
                                   AldaClient.checkForExistingServer(port);
// Path: src/alda/error/AlreadyUpException.java
// public class AlreadyUpException extends AldaException {
// 
//   public AlreadyUpException(String msg) {
//     super(msg);
//   }
// 
//   @Override
//   public ExitCode getExitCode() { return ExitCode.USER_ERROR; }
// 
// }
// 
// Path: src/alda/error/InvalidOptionsException.java
// public class InvalidOptionsException extends AldaException {
// 
//   public InvalidOptionsException(String msg) {
//     super(msg);
//   }
// 
//   @Override
//   public ExitCode getExitCode() { return ExitCode.USER_ERROR; }
// 
// }
// 
// Path: src/alda/error/NoAvailableWorkerException.java
// public class NoAvailableWorkerException extends AldaException {
// 
//   public NoAvailableWorkerException(String msg) {
//     super(msg);
//   }
// 
//   @Override
//   public ExitCode getExitCode() { return ExitCode.RUNTIME_ERROR; }
// 
// }
// 
// Path: src/alda/error/NoResponseException.java
// public class NoResponseException extends AldaException {
// 
//   public NoResponseException(String msg) {
//     super(msg);
//   }
// 
//   @Override
//   public ExitCode getExitCode() { return ExitCode.NETWORK_ERROR; }
// 
// }
// 
// Path: src/alda/error/ParseError.java
// public class ParseError extends AldaException {
// 
//   public ParseError(String msg) {
//     super(msg);
//   }
// 
//   @Override
//   public ExitCode getExitCode() { return ExitCode.USER_ERROR; }
// 
// }
// 
// Path: src/alda/error/SystemException.java
// public class SystemException extends AldaException {
//   public SystemException(String msg) {
//     super(msg);
//   }
// 
//   public SystemException(String msg, Throwable e) {
//     super(msg, e);
//   }
// 
//   @Override
//   public ExitCode getExitCode() { return ExitCode.SYSTEM_ERROR; }
// 
// }
// 
// Path: src/alda/error/UnsuccessfulException.java
// public class UnsuccessfulException extends AldaException {
// 
//   public UnsuccessfulException(String msg) {
//     super(msg);
//   }
// 
//   @Override
//   public ExitCode getExitCode() { return ExitCode.UNSPECIFIED_ERROR; }
// 
// }


// Path: src/alda/AldaServer.java
import alda.error.AlreadyUpException;
import alda.error.InvalidOptionsException;
import alda.error.NoAvailableWorkerException;
import alda.error.NoResponseException;
import alda.error.ParseError;
import alda.error.SystemException;
import alda.error.UnsuccessfulException;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.UUID;
import org.apache.commons.lang3.SystemUtils;
import org.fusesource.jansi.AnsiConsole;
import static org.fusesource.jansi.Ansi.*;
import static org.fusesource.jansi.Ansi.Color.*;

  }

  private void announceServerDown(boolean isGood) {
    Color color = isGood ? GREEN : RED;
    String glyph = isGood ? CHECKMARK : X;
    if (noColor) {
      msg("Server down " + glyph);
    } else {
      msg(ansi().a("Server down ").fg(color).a(glyph).reset().toString());
    }
  }

  private void announceServerDown() {
    announceServerDown(false);
  }

  public void upBg(int numberOfWorkers)
    throws InvalidOptionsException, NoResponseException, AlreadyUpException,
           SystemException {
    assertNotRemoteHost();

    boolean serverAlreadyUp = checkForConnection();
    if (serverAlreadyUp) {
      throw new AlreadyUpException("Server already up.");
    }

    boolean serverAlreadyTryingToStart;
    try {
      serverAlreadyTryingToStart = SystemUtils.IS_OS_UNIX &&
                                   AldaClient.checkForExistingServer(port);
    } catch (SystemException e) {