Package org.h2.util

Examples of org.h2.util.SortedProperties


        watchdog.start();
    }

    private void lockSocket() {
        method = SOCKET;
        properties = new SortedProperties();
        properties.setProperty("method", String.valueOf(method));
        setUniqueId();
        // if this returns 127.0.0.1,
        // the computer is probably not networked
        ipAddress = NetUtils.getLocalAddress();
View Full Code Here


        return "admin.jsp";
    }

    private String adminSave() {
        try {
            Properties prop = new SortedProperties();
            int port = Integer.decode((String) attributes.get("port"));
            prop.setProperty("webPort", String.valueOf(port));
            server.setPort(port);
            boolean allowOthers = Boolean.valueOf((String) attributes.get("allowOthers")).booleanValue();
            prop.setProperty("webAllowOthers", String.valueOf(allowOthers));
            server.setAllowOthers(allowOthers);
            boolean ssl = Boolean.valueOf((String) attributes.get("ssl")).booleanValue();
            prop.setProperty("webSSL", String.valueOf(ssl));
            server.setSSL(ssl);
            server.saveProperties(prop);
        } catch (Exception e) {
            trace(e.toString());
        }
View Full Code Here

     */
    synchronized void saveProperties(Properties prop) {
        try {
            if (prop == null) {
                Properties old = loadProperties();
                prop = new SortedProperties();
                prop.setProperty("webPort", "" + SortedProperties.getIntProperty(old, "webPort", port));
                prop.setProperty("webAllowOthers", "" + SortedProperties.getBooleanProperty(old, "webAllowOthers", allowOthers));
                prop.setProperty("webSSL", "" + SortedProperties.getBooleanProperty(old, "webSSL", ssl));
            }
            ArrayList<ConnectionInfo> settings = getSettings();
View Full Code Here

        }

        public void run() {
            while (!stopNow) {
                try {
                    SortedProperties sp = new SortedProperties();
                    if (file.exists()) {
                        InputStream in = FileUtils.newInputStream(file.getName());
                        sp.load(in);
                        translation.putAll(sp);
                    } else {
                        OutputStream out = FileUtils.newOutputStream(file.getName(), false);
                        sp.putAll(translation);
                        sp.store(out, "Translation");
                    }
                    Thread.sleep(1000);
                } catch (Exception e) {
                    traceError(e);
                }
View Full Code Here

    private void lockSerialized() {
        method = SERIALIZED;
        fs.createDirs(fileName);
        if (fs.createNewFile(fileName)) {
            properties = new SortedProperties();
            properties.setProperty("method", String.valueOf(method));
            setUniqueId();
            save();
        } else {
            while (true) {
View Full Code Here

        }
    }

    private void lockFile() {
        method = FILE;
        properties = new SortedProperties();
        properties.setProperty("method", String.valueOf(method));
        setUniqueId();
        fs.createDirs(fileName);
        if (!fs.createNewFile(fileName)) {
            waitUntilOld();
View Full Code Here

        watchdog.start();
    }

    private void lockSocket() {
        method = SOCKET;
        properties = new SortedProperties();
        properties.setProperty("method", String.valueOf(method));
        setUniqueId();
        // if this returns 127.0.0.1,
        // the computer is probably not networked
        ipAddress = NetUtils.getLocalAddress();
View Full Code Here

     */
    synchronized void saveSettings(Properties prop) {
        try {
            if (prop == null) {
                Properties old = loadProperties();
                prop = new SortedProperties();
                prop.setProperty("webPort", "" + SortedProperties.getIntProperty(old, "webPort", port));
                prop.setProperty("webAllowOthers", "" + SortedProperties.getBooleanProperty(old, "webAllowOthers", ssl));
                prop.setProperty("webSSL", "" + SortedProperties.getBooleanProperty(old, "webSSL", allowOthers));
            }
            ArrayList<ConnectionInfo> settings = getSettings();
View Full Code Here

        }

        public void run() {
            while (!stopNow) {
                try {
                    SortedProperties sp = new SortedProperties();
                    if (file.exists()) {
                        InputStream in = IOUtils.openFileInputStream(file.getName());
                        sp.load(in);
                        translation.putAll(sp);
                    } else {
                        OutputStream out = IOUtils.openFileOutputStream(file.getName(), false);
                        sp.putAll(translation);
                        sp.store(out, "Translation");
                    }
                    Thread.sleep(1000);
                } catch (Exception e) {
                    traceError(e);
                }
View Full Code Here

        return "admin.jsp";
    }

    private String adminSave() {
        try {
            Properties prop = new SortedProperties();
            int port = Integer.decode((String) attributes.get("port"));
            prop.setProperty("webPort", String.valueOf(port));
            server.setPort(port);
            boolean allowOthers = Boolean.valueOf((String) attributes.get("allowOthers")).booleanValue();
            prop.setProperty("webAllowOthers", String.valueOf(allowOthers));
            server.setAllowOthers(allowOthers);
            boolean ssl = Boolean.valueOf((String) attributes.get("ssl")).booleanValue();
            prop.setProperty("webSSL", String.valueOf(ssl));
            server.setSSL(ssl);
            server.saveSettings(prop);
        } catch (Exception e) {
            trace(e.toString());
        }
View Full Code Here

TOP

Related Classes of org.h2.util.SortedProperties

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.