// Path: src/main/java/com/dogeops/cantilever/utils/ConfigurationSingleton.java
// public enum ConfigurationSingleton {
// 	instance;
// 	private static final Logger logger = Logger
// 			.getLogger(ConfigurationSingleton.class.getName());
// 
// 	private Properties props = new Properties();
// 
// 	private ConfigurationSingleton() {
// 	}
// 
// 	public void readConfigFile(String config_path) {
// 		try {
// 			InputStream input = new FileInputStream(config_path);
// 			props.load(input);
// 			input.close();
// 		} catch (IOException e) {
// 			cease(logger, e.getMessage());
// 		}
// 	}
// 
// 	public String getConfigItem(String val) {
// 		try {
// 			if (props.isEmpty()) {
// 				throw new Exception("Propery file object is empty. "
// 						+ "This likely indicates that the config singleton "
// 						+ "was not properly initialized via readConfigFile.");
// 			}
// 			if (props.getProperty(val) == null) {
// 				throw new Exception("The property " + val
// 						+ " is missing from the configurtion file.");
// 			}
// 			return props.getProperty(val);
// 		} catch (Exception e) {
// 			cease(logger, e.getMessage());
// 			return null;
// 		}
// 	}
// }
// 
// Path: src/main/java/com/dogeops/cantilever/utils/Timer.java
// public class Timer {
// 
// 	private long start;
// 	private long stop;
// 	private long elapsed;
// 
// 	public void start() {
// 		start = System.currentTimeMillis();
// 	}
// 
// 	public void stop() {
// 		stop = System.currentTimeMillis();
// 	}
// 
// 	public long getElapsed() {
// 		elapsed = stop - start;
// 		return elapsed;
// 	}
// }
// 
// Path: src/main/java/com/dogeops/cantilever/utils/Util.java
// public static void cease(Logger logger, String message) {
// 	logger.error(message);
// 	System.exit(1);
// }


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.log4j.Logger;
import com.dogeops.cantilever.utils.ConfigurationSingleton;
import com.dogeops.cantilever.utils.Timer;
import com.google.gson.Gson;
import static com.dogeops.cantilever.utils.Util.cease;
		if (folder.exists()) {
			for (File file : folder.listFiles()) {
				fileCount++;
				logger.info("Pasring file: " + file.getAbsolutePath());
				try {
					BufferedReader br = new BufferedReader(new FileReader(
							file.getAbsolutePath()));
					String line = null;
					while ((line = br.readLine()) != null) {
						logger.trace(line);
						line = line.trim();

						Pattern p = Pattern.compile(log_regex);
						Matcher m = p.matcher(line);
						try {
							m.find();
							HTTPLogObject hl = new HTTPLogObject(
									m.group("TIMESTAMP"), m.group("METHOD"),
									m.group("REQUEST"), m.group("BYTES"), m
											.group("USERAGENT").replace("\"",
													""));

							ReplayCache.instance.addToCache(hl);
						} catch (Exception e) {
							logger.error("Unparsable line: " + line + " - "
									+ e.getMessage());
						}
					}
					br.close();
				} catch (FileNotFoundException e) {
// Path: src/main/java/com/dogeops/cantilever/utils/ConfigurationSingleton.java
// public enum ConfigurationSingleton {
// 	instance;
// 	private static final Logger logger = Logger
// 			.getLogger(ConfigurationSingleton.class.getName());
// 
// 	private Properties props = new Properties();
// 
// 	private ConfigurationSingleton() {
// 	}
// 
// 	public void readConfigFile(String config_path) {
// 		try {
// 			InputStream input = new FileInputStream(config_path);
// 			props.load(input);
// 			input.close();
// 		} catch (IOException e) {
// 			cease(logger, e.getMessage());
// 		}
// 	}
// 
// 	public String getConfigItem(String val) {
// 		try {
// 			if (props.isEmpty()) {
// 				throw new Exception("Propery file object is empty. "
// 						+ "This likely indicates that the config singleton "
// 						+ "was not properly initialized via readConfigFile.");
// 			}
// 			if (props.getProperty(val) == null) {
// 				throw new Exception("The property " + val
// 						+ " is missing from the configurtion file.");
// 			}
// 			return props.getProperty(val);
// 		} catch (Exception e) {
// 			cease(logger, e.getMessage());
// 			return null;
// 		}
// 	}
// }
// 
// Path: src/main/java/com/dogeops/cantilever/utils/Timer.java
// public class Timer {
// 
// 	private long start;
// 	private long stop;
// 	private long elapsed;
// 
// 	public void start() {
// 		start = System.currentTimeMillis();
// 	}
// 
// 	public void stop() {
// 		stop = System.currentTimeMillis();
// 	}
// 
// 	public long getElapsed() {
// 		elapsed = stop - start;
// 		return elapsed;
// 	}
// }
// 
// Path: src/main/java/com/dogeops/cantilever/utils/Util.java
// public static void cease(Logger logger, String message) {
// 	logger.error(message);
// 	System.exit(1);
// }


// Path: src/main/java/com/dogeops/cantilever/logreader/HTTPLogReader.java
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.log4j.Logger;
import com.dogeops.cantilever.utils.ConfigurationSingleton;
import com.dogeops.cantilever.utils.Timer;
import com.google.gson.Gson;
import static com.dogeops.cantilever.utils.Util.cease;

		if (folder.exists()) {
			for (File file : folder.listFiles()) {
				fileCount++;
				logger.info("Pasring file: " + file.getAbsolutePath());
				try {
					BufferedReader br = new BufferedReader(new FileReader(
							file.getAbsolutePath()));
					String line = null;
					while ((line = br.readLine()) != null) {
						logger.trace(line);
						line = line.trim();

						Pattern p = Pattern.compile(log_regex);
						Matcher m = p.matcher(line);
						try {
							m.find();
							HTTPLogObject hl = new HTTPLogObject(
									m.group("TIMESTAMP"), m.group("METHOD"),
									m.group("REQUEST"), m.group("BYTES"), m
											.group("USERAGENT").replace("\"",
													""));

							ReplayCache.instance.addToCache(hl);
						} catch (Exception e) {
							logger.error("Unparsable line: " + line + " - "
									+ e.getMessage());
						}
					}
					br.close();
				} catch (FileNotFoundException e) {
					cease(logger, e.getMessage());