use of org.apache.karaf.shell.impl.action.command.DefaultActionPreparator in project karaf by apache.
the class Execute method execute.
static void execute(InstanceCommandSupport command, File storageFile, String[] args) throws Exception {
DefaultActionPreparator dap = new DefaultActionPreparator();
List<Object> params = new ArrayList<>(Arrays.asList(args));
// this is the actual command name
params.remove(0);
if (!dap.prepare(command, null, params)) {
return;
}
InstanceServiceImpl instanceService = new InstanceServiceImpl();
instanceService.setStorageLocation(storageFile);
command.setInstanceService(instanceService);
command.execute();
}
Aggregations