Пример #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");
    }
  }
Пример #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();
  }
Пример #3
0
 public void save() {
   File file = fileCheck(savePath);
   try {
     this.save(file);
   } catch (IOException e) {
     plugin.log("saving config failed.");
   }
 }
Пример #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;
 }
Пример #5
0
 public YamlConfigExtended(String savePath) {
   super();
   this.savePath = savePath;
   plugin = Clans.getPlugin();
 }