use of org.structr.web.maintenance.DirectFileImportCommand in project structr by structr.
the class DirectFileImportConsoleCommand method run.
@Override
public void run(final SecurityContext securityContext, final List<String> parameters, final Writable writable) throws FrameworkException, IOException {
final Principal user = securityContext.getUser(false);
if (user != null && user.isAdmin()) {
final DirectFileImportCommand cmd = StructrApp.getInstance(securityContext).command(DirectFileImportCommand.class);
cmd.setLogBuffer(writable);
cmd.execute(toMap("source", getParameter(parameters, 1), "target", getParameter(parameters, 2), "mode", getParameter(parameters, 3), "existing", getParameter(parameters, 4), "index", getParameter(parameters, 5)));
} else {
writable.println("You must be admin user to use this command.");
}
}
Aggregations