AbstractComponent mySandbox = platform.getDefaultComponentProvider().createSandbox(userId);
AbstractComponent dropbox = platform.getDefaultComponentProvider().createDropbox(userId);
String group = System.getProperty(DEFAULT_GROUP_PROP, MCTProperties.DEFAULT_MCT_PROPERTIES.getProperty(DEFAULT_GROUP_PROP, ""));
if (group.isEmpty()) {
throw new MCTRuntimeException("Default group not specified, set the default group in mct.properties using the " + DEFAULT_GROUP_PROP + " property.");
}
platform.getPersistenceProvider().addNewUser(userId, group, mySandbox, dropbox);
currentUser = platform.getPersistenceProvider().getUser(userId);
} else {
throw new MCTRuntimeException("MCT user '" + whoami
+ "' is not in the MCT database. You can load MCT user(s) using MCT's load user tool.");
}
}
GlobalContext.getGlobalContext().switchUser(currentUser, null);
return true;