Esempio n. 1
0
  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");
    }
  }
Esempio n. 2
0
  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();
  }
Esempio n. 3
0
 public void save() {
   File file = fileCheck(savePath);
   try {
     this.save(file);
   } catch (IOException e) {
     plugin.log("saving config failed.");
   }
 }
Esempio n. 4
0
 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;
 }
Esempio n. 5
0
 public YamlConfigExtended(String savePath) {
   super();
   this.savePath = savePath;
   plugin = Clans.getPlugin();
 }