|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.it.RestHelper
public class RestHelper
Provides methods for creating REST WebResource objects and processing REST calls.
Field Summary | |
---|---|
static java.lang.String |
BASE_URL
|
static java.lang.String |
REST_PATH
|
Constructor Summary | |
---|---|
RestHelper()
|
Method Summary | ||
---|---|---|
static void |
doDeleteJson(java.lang.String url,
User user)
|
|
static
|
doGet(com.sun.jersey.api.client.WebResource resource,
java.lang.Class<T> entityClass)
|
|
static
|
doGet(com.sun.jersey.api.client.WebResource resource,
java.lang.Class<T> entityClass,
java.lang.String requestType)
|
|
static com.sun.jersey.api.client.ClientResponse |
doGetRequest(com.sun.jersey.api.client.WebResource resource,
java.lang.String requestType)
|
|
static java.net.URI |
doPost(com.sun.jersey.api.client.WebResource resource,
java.lang.Object entity)
|
|
static
|
doPut(com.sun.jersey.api.client.WebResource resource,
T entity)
|
|
static
|
doPut(com.sun.jersey.api.client.WebResource resource,
T entity,
java.lang.String requestType)
|
|
static
|
doRawGet(com.sun.jersey.api.client.WebResource resource,
java.lang.Class<T> entityClass)
Do a get without asserting success |
|
static
|
doRawGet(com.sun.jersey.api.client.WebResource resource,
java.lang.Class<T> entityClass,
java.lang.String requestType)
Do a get without asserting success, specifying the request type. |
|
static com.sun.jersey.api.client.WebResource |
expand(com.sun.jersey.api.client.WebResource webResource,
java.lang.String... values)
|
|
static com.sun.jersey.api.client.WebResource |
expandWithIndexes(com.sun.jersey.api.client.WebResource webResource,
java.lang.String value,
int start,
int end)
|
|
static org.codehaus.jackson.JsonNode |
fetchJsonResponse(com.sun.jersey.api.client.WebResource resource)
Send a GET request to the provided WebResource and return the response as a JSON object. |
|
static java.lang.String |
getFullRestPath()
|
|
static com.sun.jersey.api.client.ClientResponse |
getGETResponse(java.lang.String relativePath,
User user,
java.util.Map<java.lang.String,java.lang.String> params)
|
|
static JSONObject |
getJsonResponse(com.sun.jersey.api.client.WebResource resource)
Deprecated. Since 5.4 Use fetchJsonResponse(com.sun.jersey.api.client.WebResource) |
|
static java.lang.String |
getJsonResponseString(com.sun.jersey.api.client.WebResource resource)
Send a GET request to the provided WebResource and return the response as a JSON string. |
|
static com.sun.jersey.api.client.WebResource |
getRootResource(User user)
|
|
static com.sun.jersey.api.client.WebResource.Builder |
newJsonResource(java.lang.String url,
User user)
Returns a new web resource accepting JSON, with OS credentials for the passed user. |
|
static com.sun.jersey.api.client.WebResource |
newResource(java.lang.String url,
User user)
Returns a new web resource with OS credentials for the passed user. |
|
static com.sun.jersey.api.client.WebResource |
newResource(User user)
|
|
static org.codehaus.jackson.JsonNode |
postJson(java.lang.String url,
java.lang.String jsonPayload,
User user)
|
|
static void |
postJsonWithNoResponse(java.lang.String url,
java.lang.String jsonPayload,
User user)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BASE_URL
public static final java.lang.String REST_PATH
Constructor Detail |
---|
public RestHelper()
Method Detail |
---|
public static com.sun.jersey.api.client.WebResource newResource(User user)
public static com.sun.jersey.api.client.WebResource getRootResource(User user)
public static com.sun.jersey.api.client.WebResource newResource(java.lang.String url, User user)
public static com.sun.jersey.api.client.WebResource.Builder newJsonResource(java.lang.String url, User user)
@Deprecated public static JSONObject getJsonResponse(com.sun.jersey.api.client.WebResource resource) throws JSONException
fetchJsonResponse(com.sun.jersey.api.client.WebResource)
JSONException
public static org.codehaus.jackson.JsonNode fetchJsonResponse(com.sun.jersey.api.client.WebResource resource) throws java.io.IOException
java.io.IOException
public static java.lang.String getJsonResponseString(com.sun.jersey.api.client.WebResource resource)
public static org.codehaus.jackson.JsonNode postJson(java.lang.String url, java.lang.String jsonPayload, User user) throws java.io.IOException
java.io.IOException
public static void postJsonWithNoResponse(java.lang.String url, java.lang.String jsonPayload, User user)
public static void doDeleteJson(java.lang.String url, User user)
public static <T> T doGet(com.sun.jersey.api.client.WebResource resource, java.lang.Class<T> entityClass)
public static <T> T doGet(com.sun.jersey.api.client.WebResource resource, java.lang.Class<T> entityClass, java.lang.String requestType)
public static java.lang.String getFullRestPath()
public static com.sun.jersey.api.client.ClientResponse getGETResponse(java.lang.String relativePath, User user, java.util.Map<java.lang.String,java.lang.String> params)
public static <T> T doRawGet(com.sun.jersey.api.client.WebResource resource, java.lang.Class<T> entityClass)
public static <T> T doRawGet(com.sun.jersey.api.client.WebResource resource, java.lang.Class<T> entityClass, java.lang.String requestType)
public static com.sun.jersey.api.client.ClientResponse doGetRequest(com.sun.jersey.api.client.WebResource resource, java.lang.String requestType)
public static <T> T doPut(com.sun.jersey.api.client.WebResource resource, T entity)
public static <T> T doPut(com.sun.jersey.api.client.WebResource resource, T entity, java.lang.String requestType)
public static java.net.URI doPost(com.sun.jersey.api.client.WebResource resource, java.lang.Object entity)
public static com.sun.jersey.api.client.WebResource expand(com.sun.jersey.api.client.WebResource webResource, java.lang.String... values)
public static com.sun.jersey.api.client.WebResource expandWithIndexes(com.sun.jersey.api.client.WebResource webResource, java.lang.String value, int start, int end)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |