From 846924c65789200a483c4efb423370a81f817eb0 Mon Sep 17 00:00:00 2001 From: Julien Guerinet Date: Fri, 2 May 2014 09:53:47 -0400 Subject: [PATCH] Added support for multiple config file locations depending on the platform --- src/stringparser/StringParser.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/stringparser/StringParser.java b/src/stringparser/StringParser.java index 32ee140..f0035f8 100644 --- a/src/stringparser/StringParser.java +++ b/src/stringparser/StringParser.java @@ -46,7 +46,14 @@ public class StringParser{ public static void main(String[] args) throws IOException { //Read from the config file - BufferedReader configReader = new BufferedReader(new FileReader("../config.txt")); + BufferedReader configReader; + try{ + configReader = new BufferedReader(new FileReader("../config.txt")); + } + catch(FileNotFoundException e){ + configReader = new BufferedReader(new FileReader("config.txt")); + } + String line; while ((line = configReader.readLine()) != null) {