@BodyParser.Of(BodyParser.MultipartFormData.class)
public Result create() {
String path = getRefererPath();
MultipartFormData body = request().body().asMultipartFormData();
FilePart bundle = body.getFile("bundle");
if (bundle != null) {
CreateBundleRequest cbr;
try {
File file = bundle.getFile();
String bundleContents = Files.toString(file, StandardCharsets.UTF_8);
cbr = Json.fromJson(Json.parse(bundleContents), CreateBundleRequest.class);
} catch (IOException e) {
Logger.error("Could not parse uploaded bundle: " + e);
flash("error", "The uploaded bundle could not be applied: does it have the right format?");