Package wecui.config

Examples of wecui.config.ConfigurationNode


        if (controller.configuration.ignoreUpdates()) {
            return;
        }

        InputStream is = null;
        ConfigurationNode node = new ConfigurationNode(new HashMap<String, Object>());

        try {
            URL url = new URL(controller.getConfiguration().getUpdateFile());
            url.openConnection();
            is = url.openStream();

            Yaml yaml = new Yaml();
            Object out = yaml.load(new UnicodeReader(is));

            try {
                if (null != out) {
                    node.setRoot((Map<String, Object>) out);
                }
            } catch (ClassCastException e) {
                throw new ConfigurationException("Root document must be an key-value structure");
            }

            String currentVersion = node.getString("updaterVersion" + this.updaterVersion + ".current");
            List<String> supportedVersions = node.getStringList("updaterVersion" + this.updaterVersion + ".supported", new ArrayList<String>());

            if (currentVersion != null && !currentVersion.equals(WorldEditCUI.VERSION) && !(currentVersion + "beta").equals(WorldEditCUI.VERSION)) {
                if (supportedVersions != null && !supportedVersions.contains(WorldEditCUI.VERSION)) {
                    controller.getObfuscation().showChatMessage(ChatColor.RED + "Your WorldEditCUI version is out of date! ");
                    controller.getObfuscation().showChatMessage(ChatColor.RED + "The latest version is " + currentVersion + ". http://bit.ly/wecui");
View Full Code Here

TOP

Related Classes of wecui.config.ConfigurationNode

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.