public void preprocess(Run run) {
    File logFile = new File(getRunDir(run), "genetik.log");

    try {
      SimpleFileHandler fh = new SimpleFileHandler(logFile);
      fh.setFormatter(new CompactFormatter());

      Logger logger = Logger.getLogger(GenetikConstants.LOGGER);
      logger.setLevel(Level.INFO);
      logger.setUseParentHandlers(false);
      Handler handlers[] = logger.getHandlers();

      logger.addHandler(fh);

      for (Handler h : handlers) {
        logger.removeHandler(h);

        if (h instanceof SimpleFileHandler) h.close(); // close our old one
      }
    } catch (Exception exp) {
      throw new IllegalArgumentException(
          "Unable to create log file at " + logFile.getAbsolutePath());
    }

    super.preprocess(run);
  }
 public void saveRunData(Run run, String name, String data) {
   File file = new File(getRunDir(run), name);
   try {
     BufferedWriter writer = new BufferedWriter(new FileWriter(file));
     writer.write(data);
     writer.close();
   } catch (Exception exp) {
     throw new IllegalArgumentException(
         "Error trying to save data to " + file.getAbsolutePath(), exp);
   }
 }
  public String getRunData(Run run, String name) {
    File file = new File(getRunDir(run), name);
    String retVal = null;

    if (!file.exists()) return null;

    try {
      BufferedReader reader = new BufferedReader(new FileReader(file));
      StringBuilder builder = new StringBuilder();
      String line = null;

      while ((line = reader.readLine()) != null) {
        builder.append(line);
      }

      reader.close();
      retVal = builder.toString();
    } catch (Exception exp) {
      throw new IllegalArgumentException(
          "Error trying to read data at " + file.getAbsolutePath(), exp);
    }
    return retVal;
  }