Skip to content

Commit

Permalink
Create files if they don't already exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe12o committed Feb 4, 2014
1 parent 81eb9a2 commit df153eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/skcraft/alicefixes/AliceTransformer.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public AliceTransformer() {
Blacklist.load(configDir);
File configFile = new File(configDir, "AFPatches.json");

if(configFile.isFile()) {
if(!configFile.createNewFile()) {
Gson gson = new Gson();
JsonObject obj = parser.parse(FileUtils.readFileToString(configFile)).getAsJsonObject();
PatchList patchList = gson.fromJson(obj, PatchList.class);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/skcraft/alicefixes/Blacklist.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public static void load(File configDir) {
try {
Gson gson = new Gson();
config = new File(configDir, "Blacklists.json");
config.createNewFile();
BufferedReader br = new BufferedReader(new FileReader(config));
BlackLists storedLists = gson.fromJson(br, BlackLists.class);
if(storedLists != null) {
Expand Down

0 comments on commit df153eb

Please sign in to comment.