public void load() { File savePathFile = plugin.getDataFolder(); if (!savePathFile.exists()) savePathFile.mkdir(); File saveFile = fileCheck(savePath); if (saveFile == null) return; try { load(saveFile); } catch (Exception e) { plugin.log("Error on loading Enables"); } }
public void loadDelete() { File savePathFile = plugin.getDataFolder(); if (!savePathFile.exists()) savePathFile.mkdir(); File saveFile = new File(savePath); if (!saveFile.exists()) return; try { load(saveFile); } catch (Exception e) { plugin.log("Error on loading Enables"); } saveFile.delete(); }
public void save() { File file = fileCheck(savePath); try { this.save(file); } catch (IOException e) { plugin.log("saving config failed."); } }
private File fileCheck(String file) { File fileFile = new File(file); if (!fileFile.exists()) { try { fileFile.createNewFile(); } catch (IOException e) { plugin.log("Error creating new File :" + file); return null; } } return fileFile; }
public YamlConfigExtended(String savePath) { super(); this.savePath = savePath; plugin = Clans.getPlugin(); }