|
||||||||||
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 String |
BASE_URL
Deprecated. since 5.6 Use BaseUrlSelector.getBaseUrl() |
static String |
PROTOTYPE_REST_PATH
|
static String |
REST_PATH
Deprecated. since 5.6 Use PROTOTYPE_REST_PATH |
Constructor Summary | |
---|---|
RestHelper()
|
Method Summary | ||
---|---|---|
static void |
doDeleteJson(String url,
User user)
|
|
static
|
doGet(com.sun.jersey.api.client.WebResource resource,
Class<T> entityClass)
|
|
static
|
doGet(com.sun.jersey.api.client.WebResource resource,
Class<T> entityClass,
String requestType)
|
|
static com.sun.jersey.api.client.ClientResponse |
doGetRequest(com.sun.jersey.api.client.WebResource resource,
String requestType)
|
|
static URI |
doPost(com.sun.jersey.api.client.WebResource resource,
Object entity)
|
|
static
|
doPut(com.sun.jersey.api.client.WebResource resource,
T entity)
|
|
static
|
doPut(com.sun.jersey.api.client.WebResource resource,
T entity,
String requestType)
|
|
static
|
doRawGet(com.sun.jersey.api.client.WebResource resource,
Class<T> entityClass)
Do a get without asserting success |
|
static
|
doRawGet(com.sun.jersey.api.client.WebResource resource,
Class<T> entityClass,
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,
String... values)
|
|
static com.sun.jersey.api.client.WebResource |
expandWithIndexes(com.sun.jersey.api.client.WebResource webResource,
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 com.sun.jersey.api.client.Client |
getClient()
Return a jersey client configured for Jackson annotations. |
|
static com.sun.jersey.api.client.Client |
getClient(org.codehaus.jackson.map.Module jacksonModule)
Returns a Client configured with the provided jackson module for custom deserialization. |
|
static String |
getFullRestPath()
Deprecated. since 5.6. Use getPrototypeRestBaseUrl(String) or getPrototypeRestBaseUrl(BaseUrlSelector) |
|
static com.sun.jersey.api.client.ClientResponse |
getGETResponse(String relativePath,
User user,
Map<String,String> params)
Deprecated. |
|
static JSONObject |
getJsonResponse(com.sun.jersey.api.client.WebResource resource)
Deprecated. Since 5.4 Use fetchJsonResponse(com.sun.jersey.api.client.WebResource) |
|
static 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 String |
getPrototypeRestBaseUrl(BaseUrlSelector baseUrlSelector)
|
|
static String |
getPrototypeRestBaseUrl(String baseUrl)
|
|
static com.sun.jersey.api.client.WebResource |
getRootResource(User user)
Deprecated. since 5.6 Use newResource(String, User) |
|
static com.sun.jersey.api.client.Client |
newClient()
Create a new Jersey client configured for Jackson annotations. |
|
static com.sun.jersey.api.client.Client |
newClient(org.codehaus.jackson.map.Module jacksonModule)
Creates a new client configured with the provided jackson module for custom deserialization |
|
static com.sun.jersey.api.client.WebResource.Builder |
newJsonResource(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(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)
Deprecated. since 5.6 Use newResource(String, User) |
|
static org.codehaus.jackson.JsonNode |
postJson(String url,
String jsonPayload,
User user)
|
|
static void |
postJsonWithNoResponse(String url,
String jsonPayload,
User user)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@Deprecated public static final String BASE_URL
BaseUrlSelector.getBaseUrl()
public static final String PROTOTYPE_REST_PATH
@Deprecated public static final String REST_PATH
PROTOTYPE_REST_PATH
Constructor Detail |
---|
public RestHelper()
Method Detail |
---|
@Deprecated public static com.sun.jersey.api.client.WebResource newResource(User user)
newResource(String, User)
@Deprecated public static com.sun.jersey.api.client.WebResource getRootResource(User user)
newResource(String, User)
public static com.sun.jersey.api.client.Client newClient()
public static com.sun.jersey.api.client.Client newClient(org.codehaus.jackson.map.Module jacksonModule)
jacksonModule
-
public static com.sun.jersey.api.client.Client getClient(org.codehaus.jackson.map.Module jacksonModule)
public static com.sun.jersey.api.client.Client getClient()
public static com.sun.jersey.api.client.WebResource newResource(String url, User user)
public static com.sun.jersey.api.client.WebResource.Builder newJsonResource(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 IOException
IOException
public static String getJsonResponseString(com.sun.jersey.api.client.WebResource resource)
public static org.codehaus.jackson.JsonNode postJson(String url, String jsonPayload, User user) throws IOException
IOException
public static void postJsonWithNoResponse(String url, String jsonPayload, User user)
public static void doDeleteJson(String url, User user)
public static <T> T doGet(com.sun.jersey.api.client.WebResource resource, Class<T> entityClass)
public static <T> T doGet(com.sun.jersey.api.client.WebResource resource, Class<T> entityClass, String requestType)
@Deprecated public static String getFullRestPath()
getPrototypeRestBaseUrl(String)
or getPrototypeRestBaseUrl(BaseUrlSelector)
public static String getPrototypeRestBaseUrl(BaseUrlSelector baseUrlSelector)
public static String getPrototypeRestBaseUrl(String baseUrl)
@Deprecated public static com.sun.jersey.api.client.ClientResponse getGETResponse(String relativePath, User user, Map<String,String> params)
public static <T> T doRawGet(com.sun.jersey.api.client.WebResource resource, Class<T> entityClass)
public static <T> T doRawGet(com.sun.jersey.api.client.WebResource resource, Class<T> entityClass, String requestType)
public static com.sun.jersey.api.client.ClientResponse doGetRequest(com.sun.jersey.api.client.WebResource resource, 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, String requestType)
public static URI doPost(com.sun.jersey.api.client.WebResource resource, Object entity)
public static com.sun.jersey.api.client.WebResource expand(com.sun.jersey.api.client.WebResource webResource, String... values)
public static com.sun.jersey.api.client.WebResource expandWithIndexes(com.sun.jersey.api.client.WebResource webResource, String value, int start, int end)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |