Package net.crystalyx.bukkit.simplyperms.io

Examples of net.crystalyx.bukkit.simplyperms.io.ConfigFile


  }

  @Override
  public void run() throws Exception {
      try {
        ConfigFile importFile = new ConfigFile(plugin);
        ConfigSQL importSQL = new ConfigSQL(plugin);
        if (!importSQL.checkDatabase()) {
          throw new Exception("Could not connect to database !");
        }
       
        for (String player : importSQL.getAllPlayers()) {
          for (String group : importSQL.getPlayerGroups(player)) {
            importFile.addPlayerGroup(player, group);
          }

          for (Entry<String, Boolean> permission : importSQL.getPlayerPermissions(player).entrySet()) {
            importFile.addPlayerPermission(player, permission.getKey(), permission.getValue());
          }

          for (String world : importSQL.getPlayerWorlds(player)) {
            for (Entry<String, Boolean> permission : importSQL.getPlayerPermissions(player, world).entrySet()) {
              importFile.addPlayerPermission(player, world, permission.getKey(), permission.getValue());
            }
          }
        }
      } catch (Exception e) {
        throw e;
View Full Code Here


  }

  @Override
  public void run() throws Exception {
      try {
        ConfigFile importFile = new ConfigFile(plugin);
        ConfigSQL importSQL = new ConfigSQL(plugin);
        if (!importSQL.checkDatabase()) {
          throw new Exception("Could not connect to database !");
        }

        for (String player : importFile.getAllPlayers()) {
          for (String group : importFile.getPlayerGroups(player)) {
            importSQL.addPlayerGroup(player, group);
          }

          for (Entry<String, Boolean> permission : importFile.getPlayerPermissions(player).entrySet()) {
            importSQL.addPlayerPermission(player, permission.getKey(), permission.getValue());
          }

          for (String world : importFile.getPlayerWorlds(player)) {
            for (Entry<String, Boolean> permission : importFile.getPlayerPermissions(player, world).entrySet()) {
              importSQL.addPlayerPermission(player, world, permission.getKey(), permission.getValue());
            }
          }
        }
      } catch (Exception e) {
View Full Code Here

      ConfigSQL configsql = new ConfigSQL(this);
      if (configsql.checkDatabase()) {
        config = configsql;
      } else {
        debug("Fail to connect to database !");
        config = new ConfigFile(this);
      }
    }
    else {
      config = new ConfigFile(this);
    }
  }
View Full Code Here

TOP

Related Classes of net.crystalyx.bukkit.simplyperms.io.ConfigFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.