use of act.cli.CliOverHttpContext in project actframework by actframework.
the class CliOverHttp method run.
@PostAction("cmd")
public Result run(String cmd, ActionContext context) throws IOException {
CliHandler handler = handler(cmd);
ByteArrayOutputStream os = new ByteArrayOutputStream();
CliContext cliContext = new CliOverHttpContext(context, os);
handler.handle(cliContext);
cliContext.flush();
String txt = new String(os.toByteArray(), "UTF-8");
txt = txt.replace("^J", "\n");
return text(txt);
}
Aggregations