Package hudson.util
Class HttpResponses
- java.lang.Object
-
- org.kohsuke.stapler.HttpResponses
-
- hudson.util.HttpResponses
-
public class HttpResponses extends org.kohsuke.stapler.HttpResponsesVariousHttpResponseimplementations.This class extends from Stapler so that we can move implementations from here to Stapler periodically.
- Author:
- Kohsuke Kawaguchi
-
-
Constructor Summary
Constructors Constructor Description HttpResponses()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.kohsuke.stapler.HttpResponseerrorJSON(String message)Set the response as an error response.static org.kohsuke.stapler.HttpResponseerrorJSON(String message, Map<?,?> data)Set the response as an error response plus some data.static org.kohsuke.stapler.HttpResponseerrorJSON(String message, net.sf.json.JSONArray data)Set the response as an error response plus some data.static org.kohsuke.stapler.HttpResponseerrorJSON(String message, net.sf.json.JSONObject data)Set the response as an error response plus some data.static org.kohsuke.stapler.HttpResponseokJSON()Create an empty "ok" response.static org.kohsuke.stapler.HttpResponseokJSON(Map<?,?> data)Create 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.HttpResponsestaticResource(File f)-
Methods 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
-
-
-
-
Method Detail
-
staticResource
public static org.kohsuke.stapler.HttpResponse staticResource(File f) throws IOException
- 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
public static org.kohsuke.stapler.HttpResponse okJSON(@NonNull Map<?,?> data)Create a response containing the supplied "data".- Parameters:
data- The data.- Since:
- 2.0
-
errorJSON
public static org.kohsuke.stapler.HttpResponse errorJSON(@NonNull String message)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
-
-