Skip to content

Commit

Permalink
Added support for multiple config file locations depending on the pla…
Browse files Browse the repository at this point in the history
…tform
  • Loading branch information
jguerinet committed May 2, 2014
1 parent 27a0f36 commit 846924c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/stringparser/StringParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down

0 comments on commit 846924c

Please sign in to comment.