Examples of FileConfiguration


Examples of com.bergerkiller.bukkit.common.config.FileConfiguration

      }
    }
  }

  public static void init(String filename) {
    FileConfiguration config = new FileConfiguration(filename);
    config.load();
    for (String key : config.getKeys()) {
      String dur = config.get(key, String.class, null);
      if (dur != null) {
        TimeSign t = getTimer(key);
        t.duration = ParseUtil.parseTime(dur);
        t.startTime = System.currentTimeMillis();
      }
View Full Code Here

Examples of com.bergerkiller.bukkit.common.config.FileConfiguration

      }
    }
  }

  public static void save(String filename) {
    FileConfiguration config = new FileConfiguration(filename);
    for (TimeSign sign : timerSigns.values()) {
      config.set(sign.name, sign.getDuration());
    }
    config.save();
  }
View Full Code Here

Examples of com.bergerkiller.bukkit.common.config.FileConfiguration

  public static boolean canBreak(Material type) {
    return plugin.allowedBlockBreakTypes.contains(type);
  }

  public void loadConfig() {
    config = new FileConfiguration(this);
    config.load();
    config.setHeader("This is the configuration file of TrainCarts");
    config.addHeader("In here you can tweak TrainCarts to what you want");
    config.addHeader("For more information, you can visit the following websites:");
    config.addHeader("http://www.minecraftwiki.net/wiki/Bukkit/TrainCarts");
View Full Code Here

Examples of com.bergerkiller.bukkit.common.config.FileConfiguration

  /**
   * Loads all Train Properties and defaults from disk
   */
  public static void load() {
    loadDefaults();
    FileConfiguration config = new FileConfiguration(TrainCarts.plugin, propertiesFile);
    config.load();
    if (fixDeprecation(config)) {
      config.save();
    }
    for (ConfigurationNode node : config.getNodes()) {
      TrainProperties prop = new TrainProperties(node.getName());
      prop.load(node);
      trainProperties.put(prop.getTrainName(), prop);
    }
  }
View Full Code Here

Examples of com.bergerkiller.bukkit.common.config.FileConfiguration

  /**
   * Loads the default Train Properties from file
   */
  public static void loadDefaults() {
    defconfig = new FileConfiguration(TrainCarts.plugin, defaultPropertiesFile);
    defconfig.load();
    boolean changed = false;
    if (!defconfig.contains("default")) {
      ConfigurationNode node = defconfig.getNode("default");
      TrainProperties.EMPTY.saveAsDefault(node);
View Full Code Here

Examples of com.bergerkiller.bukkit.common.config.FileConfiguration

  /**
   * Saves all Train Properties to disk
   */
  public static void save() {
    FileConfiguration config = new FileConfiguration(TrainCarts.plugin, propertiesFile);
    for (TrainProperties prop : trainProperties.values()) {
      //does this train even exist?!
      if (prop.hasHolder() || OfflineGroupManager.contains(prop.getTrainName())) {
        prop.save(config.getNode(prop.getTrainName()));
      } else {
        config.remove(prop.getTrainName());
      }
    }
    config.save();
  }
View Full Code Here

Examples of com.notoriousdev.yamlconfig.configuration.file.FileConfiguration

    private Properties properties;
    private int chatSocketPort;

    public void load() {
        YamlConfig conf = new YamlConfig(new File("").getAbsoluteFile(), "config.yml");
        FileConfiguration config = conf.getConfig();
        setBotNickname(config.getString("bot-nickname"));
        setBotUsername(config.getString("bot-username"));
        setBotIdent(config.getString("bot-ident"));
        setBotPassword(config.getString("bot-password"));
        setCtcpFinger(config.getString("ctcp-finger-reply"));
        setCtcpVersion(config.getString("ctcp-version-reply"));
        setTrigger(config.getString("bot-trigger"));
        setPermissionDenied(config.getString("permission-denied"));
        setAutoNickChange(config.getBoolean("auto-nickchange"));
        setAutoReconnectServer(config.getBoolean("auto-reconnect"));
        setAutoRejoinChannel(config.getBoolean("auto-rejoin"));
        setAutoAcceptInvite(config.getBoolean("auto-accept-invite"));
        setChannels(config.getStringList("channels"));
        setLoggedChannels(config.getStringList("channels-log"));
        setDebug(config.getBoolean("debug"));
        setServerHostame(config.getString("server-hostname"));
        setServerPort(config.getString("server-port"));
        setUseSSL(config.getBoolean("use-ssl"));
        setVerifySSL(config.getBoolean("verify-ssl"));
        setServerPassword(config.getString("server-password"));
        setEnableChatSocket(config.getBoolean("enable-chat-socket"));
        setChatSocketPort(config.getInt("chat-socket-port"));
        System.out.println("Config loaded!");
    }
View Full Code Here

Examples of org.apache.cayenne.conf.FileConfiguration

    @Override
    public void execute() throws BuildException {
        validateParameters();

        FileConfiguration configuration = new FileConfiguration(projectFile);

        ClassLoader threadContextClassLoader = Thread.currentThread().getContextClassLoader();
        try {
            // need to set context class loader so that cayenne can find jdbc driver and
            // PasswordEncoder
            Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
            configuration.initialize();
        }
        catch (Exception ex) {
            throw new BuildException("Error loading Cayenne configuration from "
                    + projectFile, ex);
        } finally {
View Full Code Here

Examples of org.apache.commons.configuration.FileConfiguration

    public void save()
        throws RegistryException
    {
        if ( configuration instanceof FileConfiguration )
        {
            FileConfiguration fileConfiguration = (FileConfiguration) configuration;
            try
            {
                fileConfiguration.save();
            }
            catch ( ConfigurationException e )
            {
                throw new RegistryException( e.getMessage(), e );
            }
View Full Code Here

Examples of org.apache.commons.configuration.FileConfiguration

            this.giraphGraph = GiraphGraph.open(new BaseConfiguration());
            this.shell.getInterp().getContext().setProperty("g", this.giraphGraph);
        }
        if (args.size() == 1) {
            try {
                final FileConfiguration configuration = new PropertiesConfiguration();
                configuration.load(new File(args.get(0)));
                this.giraphGraph = GiraphGraph.open(configuration);
                this.shell.getInterp().getContext().setProperty("g", this.giraphGraph);
            } catch (final Exception e) {
                throw new RuntimeException(e.getMessage(), e);
            }
        } else if (args.size() == 2) {
            try {
                final FileConfiguration configuration = new PropertiesConfiguration();
                configuration.load(new File(args.get(0)));
                this.giraphGraph = GiraphGraph.open(configuration);
                this.graphVariable = args.get(1);
                this.shell.getInterp().getContext().setProperty(args.get(1), this.giraphGraph);
            } catch (final Exception e) {
                throw new RuntimeException(e.getMessage(), e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.