/* * We got more than 8 lines on that method because * we could not really delegates more for other * function. That would made the code kind of hard * to read. * */ private void getDemandExerciseRoutine(RoutingContext context) { String id = context.request().getParam("id"); Path path = Paths.get(this.workingDirectory.toString(), id + ".mkdown"); HttpServerResponse rep = context.response().setChunked(true).putHeader("content-type", "text/html"); if (Files.exists(path)) { MarkdownToHTML markdownToHTML = new MarkdownToHTML(); try { rep.write(markdownToHTML.parse(path)); } catch (IOException e) { rep.write("Unable to load " + id + ".mkdow"); } } else { rep.write("Excercice with id " + id + " no found"); } rep.end(); }