Package com.iCo6.util

Examples of com.iCo6.util.wget


            }
           
            // Check Drivers if needed
            Type type = Database.getType(Constants.Nodes.DatabaseType.toString());
            if(!(type.equals(Type.InventoryDB) || type.equals(Type.MiniDB))) {
                Drivers driver = null;
               
                switch(type) {
                    case H2DB: driver = Constants.Drivers.H2; break;
                    case MySQL: driver = Constants.Drivers.MySQL; break;
                    case SQLite: driver = Constants.Drivers.SQLite; break;
                    case Postgre: driver = Constants.Drivers.Postgre; break;
                }

                if(driver != null)
                    if(!(new File("lib", driver.getFilename()).exists())) {
                        System.out.println("[iConomy] Downloading " + driver.getFilename() + "...");
                        wget.fetch(driver.getUrl(), driver.getFilename());
                        System.out.println("[iConomy] Finished Downloading.");
                    }
            }

            // Setup Commands
View Full Code Here


            Commands.setPermission("empty", "iConomy.accounts.empty");
            Commands.setHelp("empty", new String[] { "", "Empty database of accounts." });

            // Setup Database.
            try {
                Database = new Database(
                    Constants.Nodes.DatabaseType.toString(),
                    Constants.Nodes.DatabaseUrl.toString(),
                    Constants.Nodes.DatabaseUsername.toString(),
                    Constants.Nodes.DatabasePassword.toString()
                );
View Full Code Here

            } catch (IOException ex) {
                System.out.println(ex.getMessage());
            }
           
            // Check Drivers if needed
            Type type = Database.getType(Constants.Nodes.DatabaseType.toString());
            if(!(type.equals(Type.InventoryDB) || type.equals(Type.MiniDB))) {
                Drivers driver = null;
               
                switch(type) {
                    case H2DB: driver = Constants.Drivers.H2; break;
                    case MySQL: driver = Constants.Drivers.MySQL; break;
View Full Code Here

        if(driver == null)
            return;

        if(!DbUtils.loadDriver(driver))
            throw new MissingDriver("Please make sure the " + type + " driver library jar exists.");
    }
View Full Code Here

            Mini database = iConomy.Database.getTransactionDatabase();

            if(database == null)
                return;

            Arguments entry = new Arguments(data.time);
            entry.setValue("where", data.where);
            entry.setValue("from", data.from);
            entry.setValue("to", data.to);
            entry.setValue("from_balance", data.fromBalance);
            entry.setValue("to_balance", data.toBalance);
            entry.setValue("gain", data.gain);
            entry.setValue("loss", data.loss);
            entry.setValue("set", data.set);
            database.addIndex(entry);
            database.update();

            return;
        }
View Full Code Here

            if(useInventoryDB())
                if(inventory.dataExists(name))
                    return false;

            Arguments Row = new Arguments(name);
            Row.setValue("balance", balance);
            Row.setValue("status", status);

            database.addIndex(Row.getKey(), Row);
            database.update();

            return true;
        }
View Full Code Here

                "orbdb", "orb", "exp", "xp", "xpdb", "expdb"
            )
        )
            return null;

        return new Mini(iConomy.directory.getPath(), "accounts.mini");
    }
View Full Code Here

                "orbdb", "orb", "exp", "xp", "xpdb", "expdb"
            )
        )
            return null;

        return new Mini(iConomy.directory.getPath(), "transactions.mini");
    }
View Full Code Here

    public static void insert(Transaction data) {
        if (!Constants.Nodes.Logging.getBoolean())
            return;

        if (Common.matches(iConomy.Database.getType().toString(), "inventorydb", "minidb", "orbdb")) {
            Mini database = iConomy.Database.getTransactionDatabase();

            if(database == null)
                return;

            Arguments entry = new Arguments(data.time);
            entry.setValue("where", data.where);
            entry.setValue("from", data.from);
            entry.setValue("to", data.to);
            entry.setValue("from_balance", data.fromBalance);
            entry.setValue("to_balance", data.toBalance);
            entry.setValue("gain", data.gain);
            entry.setValue("loss", data.loss);
            entry.setValue("set", data.set);
            database.addIndex(entry);
            database.update();

            return;
        }
    }
View Full Code Here

     * @param database Database File Name, any extension can be used.
     */
    public Mini(String folder, String database) {
        this.database = database;
        this.folder = folder;
        this.Database = new Manager(this.folder, this.database, true);
        this.read();
    }
View Full Code Here

TOP

Related Classes of com.iCo6.util.wget

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.