/** * Generates a 403 FORBIDDEN chunked result. */ public static Status forbidden(InputStream content) { return forbidden(content, defaultChunkSize); }
/** * Generates a 403 Forbidden result. * * @param content The file to send. * @param inline Whether the file should be sent inline, or as an attachment. * @return the result */ public static Result forbidden(File content, boolean inline) { return forbidden(content, inline, StaticFileMimeTypes.fileMimeTypes()); }
/** * Generates a 403 Forbidden result. * * @param content The file to send. * @param filename The name to send the file as. * @return the result */ public static Result forbidden(File content, String filename) { return forbidden(content, filename, StaticFileMimeTypes.fileMimeTypes()); }
/** * Generates a 403 Forbidden result. * * @param content The file to send. * @return the result */ public static Result forbidden(File content) { return forbidden(content, StaticFileMimeTypes.fileMimeTypes()); }
/** * Generates a 403 Forbidden result. * * @param content The file to send. * @param filename The name to send the file as. * @return the result */ public static Result forbidden(File content, String filename) { return forbidden(content, filename, StaticFileMimeTypes.fileMimeTypes()); }
/** * Generates a 403 Forbidden result. * * @param content The file to send. * @param filename The name to send the file as. * @return the result */ public static Result forbidden(File content, String filename) { return forbidden(content, filename, StaticFileMimeTypes.fileMimeTypes()); }
/** * Generates a 403 Forbidden result. * * @param content The file to send. * @param inline Whether the file should be sent inline, or as an attachment. * @return the result */ public static Result forbidden(File content, boolean inline) { return forbidden(content, inline, StaticFileMimeTypes.fileMimeTypes()); }
/** * Generates a 403 Forbidden result. * * @param content The file to send. * @return the result */ public static Result forbidden(File content) { return forbidden(content, StaticFileMimeTypes.fileMimeTypes()); }
/** * Generates a 403 Forbidden result. * * @param content The file to send. * @return the result */ public static Result forbidden(File content) { return forbidden(content, StaticFileMimeTypes.fileMimeTypes()); }
/** * Generates a 403 Forbidden result. * * @param content The file to send. * @param inline Whether the file should be sent inline, or as an attachment. * @return the result */ public static Result forbidden(File content, boolean inline) { return forbidden(content, inline, StaticFileMimeTypes.fileMimeTypes()); }
/** * Invoked when a client makes a request that was forbidden. * <p> * Returns Results.forbidden (401) with the included template from {@code views.html.defaultpages.unauthorized} as the content. * * @param request The forbidden request. * @param message The error message. * @return a CompletionStage containing the Result. */ protected CompletionStage<Result> onForbidden(RequestHeader request, String message) { return CompletableFuture.completedFuture(Results.forbidden(views.html.defaultpages.unauthorized.render(request.asScala()))); }
/** * Invoked when a client makes a request that was forbidden. * <p> * Returns Results.forbidden (401) with the included template from {@code views.html.defaultpages.unauthorized} as the content. * * @param request The forbidden request. * @param message The error message. * @return a CompletionStage containing the Result. */ protected CompletionStage<Result> onForbidden(RequestHeader request, String message) { return CompletableFuture.completedFuture(Results.forbidden(views.html.defaultpages.unauthorized.render(request.asScala()))); }
/** * Invoked when a client makes a request that was forbidden. * <p> * Returns Results.forbidden (401) with the included template from {@code views.html.defaultpages.unauthorized} as the content. * * @param request The forbidden request. * @param message The error message. * @return a CompletionStage containing the Result. */ protected CompletionStage<Result> onForbidden(RequestHeader request, String message) { return CompletableFuture.completedFuture(Results.forbidden(views.html.defaultpages.unauthorized.render(request.asScala()))); }
/** * Invoked when a client makes a request that was forbidden. * * @param request The forbidden request. * @param message The error message. */ protected F.Promise<Result> onForbidden(RequestHeader request, String message) { return F.Promise.<Result>pure(Results.forbidden(views.html.defaultpages.unauthorized.render())); }
@Override public Object adapt(final int code, final WebContext context) { final PlayWebContext webContext = (PlayWebContext) context; logger.debug("requires HTTP action: {}", code); if (code == HttpConstants.UNAUTHORIZED) { return unauthorized("authentication required"); } else if (code == HttpConstants.FORBIDDEN) { return forbidden("forbidden"); } else if (code == HttpConstants.TEMP_REDIRECT) { return redirect(webContext.getResponseLocation()); } else if (code == HttpConstants.OK) { final String content = webContext.getResponseContent(); logger.debug("render: {}", content); return ok(content).as(HttpConstants.HTML_CONTENT_TYPE); } final String message = "Unsupported HTTP action: " + code; logger.error(message); throw new TechnicalException(message); } }
private Result receiveData() { if (!enabled.get()) { return Results.forbidden( "UI server remote listening is currently disabled. Use UIServer.getInstance().enableRemoteListener()");
private Result receiveData() { if (!enabled.get()) { return Results.forbidden( "UI server remote listening is currently disabled. Use UIServer.getInstance().enableRemoteListener()");
private Result receiveData() { if (!enabled.get()) { return Results.forbidden( "UI server remote listening is currently disabled. Use UIServer.getInstance().enableRemoteListener()");
@Override public Result adapt(final int code, final PlayWebContext context) { logger.debug("requires HTTP action: {}", code); if (code == HttpConstants.UNAUTHORIZED) { return unauthorized("authentication required"); } else if (code == HttpConstants.FORBIDDEN) { return forbidden("forbidden"); } else if (code == HttpConstants.TEMP_REDIRECT) { return redirect(context.getLocation()); } else if (code == HttpConstants.BAD_REQUEST) { return badRequest("bad request"); } else if (code == HttpConstants.OK) { final String content = context.getResponseContent(); logger.debug("render: {}", content); return ok(content).as(HttpConstants.HTML_CONTENT_TYPE); } else if (code == HttpConstants.NO_CONTENT) { return noContent(); } final String message = "Unsupported HTTP action: " + code; logger.error(message); throw new TechnicalException(message); } }
@Override public Result adapt(final int code, final PlayWebContext context) { logger.debug("requires HTTP action: {}", code); if (code == HttpConstants.UNAUTHORIZED) { return unauthorized("authentication required"); } else if (code == HttpConstants.FORBIDDEN) { return forbidden("forbidden"); } else if (code == HttpConstants.TEMP_REDIRECT) { return redirect(context.getLocation()); } else if (code == HttpConstants.BAD_REQUEST) { return badRequest("bad request"); } else if (code == HttpConstants.OK) { final String content = context.getResponseContent(); logger.debug("render: {}", content); return ok(content).as(HttpConstants.HTML_CONTENT_TYPE); } else if (code == HttpConstants.NO_CONTENT) { return noContent(); } final String message = "Unsupported HTTP action: " + code; logger.error(message); throw new TechnicalException(message); } }