public boolean execute() throws MissingOrIncorrectArgumentException, InsufficientPermissionException {
if(errorCheck())
return true;
ShopHandler sHandler = scs.getShopHandler();
// import from showcase
if(args[1].equalsIgnoreCase("showcase")){
ShowCaseStandalone.slog(Level.INFO, "Import Showcase shops.");
ShowCaseImport si = new ShowCaseImport(scs);
if(!si.fileExists()){
Messaging.send(cs, "Could not attach to showcases.csv. Is it in your ShowCaseStandalone data folder?");
return true;
}
// load
load(sHandler, si);
}
// import from ffss
else if (args[1].equalsIgnoreCase("ffss")) {
try {
ShowCaseStandalone.slog(Level.INFO, "Import FastFileShopStorage.");
load(sHandler, new FastFileShopStorage(scs));
} catch (Throwable t) {
t.printStackTrace();
}
}
// import from sql - bukkit configuration
else if (args[1].equalsIgnoreCase("sql_bukkit")) {
try {
int count = sHandler.size();
StorageHandler storage = scs.getSQLShopStorageBukkit();
storage.load(sHandler);
Messaging.send(cs, "Imported: "+(sHandler.size() - count));
} catch (Exception e) {
Messaging.send(cs, Term.ERROR_IMPORT.get("sql_bukkit"));
}
}
// import from sql - my configuration
else if (args[1].equalsIgnoreCase("sql_scs")) {
try {
int count = sHandler.size();
StorageHandler storage = scs.getSQLShopStorageThis();
storage.load(sHandler);
Messaging.send(cs, "Imported: "+(sHandler.size() - count));
} catch (Exception e) {
Messaging.send(cs, Term.ERROR_IMPORT.get("sql_scs"));
}
}