JsonNode jn = request().body().asJson(); JsonNode type = jn.get("type"); JsonNode dataClass = jn.get("class");
@Override public Result apply(String s) { String fullPath = assetsRootDirectory + s; InputStream inputStream; try { inputStream = new ClassPathResource(fullPath).getInputStream(); } catch (Exception e) { log.debug("Could not find asset: {}", s); return ok(); } catch (Throwable t) { return ok(); } String fileName = FilenameUtils.getName(fullPath); response().setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + fileName + "\""); scala.Option<String> contentType = MimeTypes.forFileName(fileName); String ct; if (contentType.isDefined()) { ct = contentType.get(); } else { ct = "application/octet-stream"; } return ok(inputStream).as(ct); } }
JsonNode jn = request().body().asJson(); JsonNode type = jn.get("type"); JsonNode dataClass = jn.get("class");
JsonNode jn = request().body().asJson(); JsonNode type = jn.get("type"); JsonNode dataClass = jn.get("class");
@Override public Result apply(String s) { String fullPath = assetsRootDirectory + s; InputStream inputStream; try { inputStream = new ClassPathResource(fullPath).getInputStream(); } catch (Exception e) { log.debug("Could not find asset: {}", s); return ok(); } catch (Throwable t) { return ok(); } String fileName = FilenameUtils.getName(fullPath); response().setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + fileName + "\""); scala.Option<String> contentType = MimeTypes.forFileName(fileName); String ct; if (contentType.isDefined()) { ct = contentType.get(); } else { ct = "application/octet-stream"; } return ok(inputStream).as(ct); } }
@Override public Result apply(String s) { String fullPath = assetsRootDirectory + s; InputStream inputStream; try { inputStream = new ClassPathResource(fullPath).getInputStream(); } catch (Exception e) { log.debug("Could not find asset: {}", s); return ok(); } catch (Throwable t) { return ok(); } String fileName = FilenameUtils.getName(fullPath); response().setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + fileName + "\""); scala.Option<String> contentType = MimeTypes.forFileName(fileName); String ct; if (contentType.isDefined()) { ct = contentType.get(); } else { ct = "application/octet-stream"; } return ok(inputStream).as(ct); } }
/** * Returns the form errors serialized as Json. */ public org.codehaus.jackson.JsonNode errorsAsJson() { return errorsAsJson(Http.Context.Implicit.lang()); }
/** * Returns the form errors serialized as Json. */ public com.fasterxml.jackson.databind.JsonNode errorsAsJson() { return errorsAsJson(Http.Context.Implicit.lang()); }