1 package at.ac.tuwien.lsdc;
4 import java.io.IOException;
6 import org.slf4j.Logger;
7 import org.slf4j.LoggerFactory;
9 public class JobGenerator {
10 private static final Logger log = LoggerFactory.getLogger(JobGenerator.class);
11 private static final String USAGE = "JobGenerator needs exactly 3 parameters: Szenario, count, targetFile";
13 private enum ScenarioType { A, B, C };
15 private static ScenarioType scenario;
16 private static int count;
17 private static File targetFile;
20 public static void main(String[] args) throws Exception {
21 System.out.println("args: " + args + " len: " + args.length);
22 if (args.length != 3) {
26 log.info("Generate CSV with...");
27 doArgumentHandling(args);
30 private static void doArgumentHandling(String[] args) {
31 String scenarioStr = args[0];
32 String countStr = args[1];
33 String targetFileStr = args[2];
34 scenario = ScenarioType.valueOf(scenarioStr);
36 boolean fileWriteOK = false;
37 count = Integer.parseInt(countStr);
38 targetFile = new File(targetFileStr);
39 if (targetFile.exists()) {
40 fileWriteOK = targetFile.canWrite();
42 targetFile.createNewFile();
46 throw new IOException("Can not write to File " + targetFileStr);
47 } catch (Exception e) {