Test json writer

This commit is contained in:
sekwah 2018-01-23 06:01:30 +00:00
parent 5c33600008
commit 13ecfcea8a
2 changed files with 6 additions and 2 deletions

View File

@ -5,7 +5,7 @@ package com.sekwah.advancedportals.core.util;
*/ */
public class Config { public class Config {
private boolean useOnlySpecialAxe = false; private boolean useOnlySpecialAxe;
private String axeMaterial = "IRON_AXE"; private String axeMaterial = "IRON_AXE";

View File

@ -50,8 +50,12 @@ public class DataStorage {
} }
public void storeJson(Object dataHolder, String location) { public void storeJson(Object dataHolder, String location) {
String json = gson.toJson(dataHolder);
try { try {
gson.toJson(dataHolder, new FileWriter(new File(this.dataFolder, location))); FileWriter fileWriter = new FileWriter(new File(this.dataFolder, location));
System.out.println(json);
fileWriter.write(json);
fileWriter.close();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }