Examples of loadFromString()


Examples of com.taobao.metamorphosis.server.utils.MetaConfig.loadFromString()

    private void tryReloadConfig(BooleanCommand resp) throws UnsupportedEncodingException, IOException,
    FileNotFoundException {
        String str = resp.getErrorMsg();
        str = new String(str.getBytes("utf-8"));
        MetaConfig newConfig = new MetaConfig();
        newConfig.loadFromString(str);
        // If topics config changed
        if (!newConfig.getTopicConfigMap().equals(this.broker.getMetaConfig().getTopicConfigMap())) {
            File tmpFile = File.createTempFile("meta_config", "slave_sync");
            BufferedWriter writer =
                    new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tmpFile), SLAVE_CONFIG_ENCODING));
View Full Code Here

Examples of l2p.util.NetList.LoadFromString()

      }
      boolean invalid = false;
      try
      {
        NetList allowedList = new NetList();
        allowedList.LoadFromString(ip, ",");
        if(!allowedList.isIpInNets(activeChar.getIP()))
        {
          invalid = true;
        }
      }
View Full Code Here

Examples of l2p.util.NetList.LoadFromString()

        if(allowedIps != null && !allowedIps.isEmpty() && !allowedIps.equals("*"))
        {
          if(!expired)
          {
            NetList allowedList = new NetList();
            allowedList.LoadFromString(allowedIps, ",");
            if(!allowedList.isIpInNets(client.getIpAddress()))
            {
              return new Status().setState(State.IP_ACCESS_DENIED);
            }
          }
View Full Code Here

Examples of org.bukkit.configuration.file.YamlConfiguration.loadFromString()

        }
       
        // Containers
        if (modify instanceof InventoryHolder) {
          YamlConfiguration config = new YamlConfiguration();
          config.loadFromString(query.getString("metadata"));
          ((InventoryHolder) modify).getInventory().clear();
          for (Object obj : config.getList("items")) {
            if (obj instanceof ItemStack) {
              ((InventoryHolder) modify).getInventory().addItem((ItemStack) obj);
            }
View Full Code Here

Examples of org.bukkit.configuration.file.YamlConfiguration.loadFromString()

            YamlConfiguration toSerialize = new YamlConfiguration();
            toSerialize.set("color", base);
            String serialized = toSerialize.saveToString();

            YamlConfiguration deserialized = new YamlConfiguration();
            deserialized.loadFromString(serialized);

            assertThat(testColor.name + " on " + serialized, base, is(deserialized.getColor("color")));
        }
    }
View Full Code Here

Examples of org.bukkit.configuration.file.YamlConfiguration.loadFromString()

            if (!text.equals(new String(contents, Charsets.UTF_8))) {
                getLogger().warning("Default system encoding may have misread config.yml from plugin jar");
            }

            try {
                defConfig.loadFromString(text);
            } catch (final InvalidConfigurationException e) {
                getLogger().log(Level.SEVERE, "Cannot load configuration from jar", e);
            }
        }
View Full Code Here

Examples of org.bukkit.configuration.file.YamlConfiguration.loadFromString()

        return null;
    }

      YamlConfiguration defConfig = new YamlConfiguration();
      try {
      defConfig.loadFromString(config);
      return defConfig;
    } catch (InvalidConfigurationException e) {
      SimpleSpleef.log.severe("[SimpleSpleef] Could not convert resource file " + file + " to valid configuration! Reason: " + e.getMessage());
      return null;
    }
View Full Code Here

Examples of org.bukkit.configuration.file.YamlConfiguration.loadFromString()

  @SuppressWarnings("unchecked")
  @Nullable
  public final static <T extends ConfigurationSerializable> T deserializeCS(final String s, final Class<T> c) {
    final YamlConfiguration y = new YamlConfiguration();
    try {
      y.loadFromString(s);
    } catch (final InvalidConfigurationException e) {
      return null;
    }
    final Object o = y.get("value");
    if (!c.isInstance(o))
View Full Code Here

Examples of org.bukkit.configuration.file.YamlConfiguration.loadFromString()

  @Deprecated
  @Nullable
  public final static <T extends ConfigurationSerializable> T deserializeCSOld(final String s, final Class<T> c) {
    final YamlConfiguration y = new YamlConfiguration();
    try {
      y.loadFromString(s.replace("\uFEFF", "\n"));
    } catch (final InvalidConfigurationException e) {
      return null;
    }
    final Object o = y.get("value");
    if (!c.isInstance(o))
View Full Code Here

Examples of org.jwildfire.script.ActionList.loadFromString()

  public void saveScriptAction() throws Exception {
    int row = actionTable.getSelectedRow();
    if ((row >= 0) && (row < actionList.size())) {
      ActionList lActionList = new ActionList();
      lActionList.loadFromString(scriptActionTextArea.getText());
      actionList.remove(row);
      for (Action action : lActionList) {
        if (row < actionList.size())
          actionList.add(row, action);
        else
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.