Package hudson.util
Class HttpResponses
java.lang.Object
org.kohsuke.stapler.HttpResponses
hudson.util.HttpResponses
public class HttpResponses
extends org.kohsuke.stapler.HttpResponses
Various
HttpResponse implementations.
This class extends from Stapler so that we can move implementations from here to Stapler periodically.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested classes/interfaces inherited from class org.kohsuke.stapler.HttpResponses
org.kohsuke.stapler.HttpResponses.ErrorCustomizer, org.kohsuke.stapler.HttpResponses.HttpResponseException -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.kohsuke.stapler.HttpResponseSet the response as an error response.static org.kohsuke.stapler.HttpResponseSet the response as an error response plus some data.static org.kohsuke.stapler.HttpResponseSet the response as an error response plus some data.static org.kohsuke.stapler.HttpResponseSet the response as an error response plus some data.static org.kohsuke.stapler.HttpResponseokJSON()Create an empty "ok" response.static org.kohsuke.stapler.HttpResponseCreate a response containing the supplied "data".static org.kohsuke.stapler.HttpResponseokJSON(net.sf.json.JSONArray data) Create a response containing the supplied "data".static org.kohsuke.stapler.HttpResponseokJSON(net.sf.json.JSONObject data) Create a response containing the supplied "data".static org.kohsuke.stapler.HttpResponseMethods inherited from class org.kohsuke.stapler.HttpResponses
error, error, error, errorWithoutStack, forbidden, forwardToPreviousPage, forwardToView, forwardToView, html, literalHtml, notFound, ok, plainText, redirectTo, redirectTo, redirectToContextRoot, redirectToDot, redirectViaContextPath, redirectViaContextPath, staticResource, staticResource, status, text, wrap
-
Constructor Details
-
HttpResponses
public HttpResponses()
-
-
Method Details
-
staticResource
- Throws:
IOException
-
okJSON
public static org.kohsuke.stapler.HttpResponse okJSON()Create an empty "ok" response.- Since:
- 2.0
-
okJSON
public static org.kohsuke.stapler.HttpResponse okJSON(@NonNull net.sf.json.JSONObject data) Create a response containing the supplied "data".- Parameters:
data- The data.- Since:
- 2.0
-
okJSON
public static org.kohsuke.stapler.HttpResponse okJSON(@NonNull net.sf.json.JSONArray data) Create a response containing the supplied "data".- Parameters:
data- The data.- Since:
- 2.0
-
okJSON
Create a response containing the supplied "data".- Parameters:
data- The data.- Since:
- 2.0
-
errorJSON
Set the response as an error response.- Parameters:
message- The error "message" set on the response.- Returns:
thisobject.- Since:
- 2.0
-
errorJSON
public static org.kohsuke.stapler.HttpResponse errorJSON(@NonNull String message, @NonNull Map<?, ?> data) Set the response as an error response plus some data.- Parameters:
message- The error "message" set on the response.data- The data.- Returns:
thisobject.- Since:
- 2.119
-
errorJSON
public static org.kohsuke.stapler.HttpResponse errorJSON(@NonNull String message, @NonNull net.sf.json.JSONObject data) Set the response as an error response plus some data.- Parameters:
message- The error "message" set on the response.data- The data.- Returns:
thisobject.- Since:
- 2.115
-
errorJSON
public static org.kohsuke.stapler.HttpResponse errorJSON(@NonNull String message, @NonNull net.sf.json.JSONArray data) Set the response as an error response plus some data.- Parameters:
message- The error "message" set on the response.data- The data.- Returns:
thisobject.- Since:
- 2.115
-