public class RestHelper extends Object
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
RestHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
doDeleteJson(String url,
User user) |
static <T> T |
doGet(com.sun.jersey.api.client.WebResource resource,
Class<T> entityClass) |
static <T> T |
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 <T> T |
doPut(com.sun.jersey.api.client.WebResource resource,
T entity) |
static <T> T |
doPut(com.sun.jersey.api.client.WebResource resource,
T entity,
String requestType) |
static <T> T |
doRawGet(com.sun.jersey.api.client.WebResource resource,
Class<T> entityClass)
Do a get without asserting success
|
static <T> T |
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) |
@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
@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)
public static com.sun.jersey.api.client.Client getClient(org.codehaus.jackson.map.Module jacksonModule)
public static com.sun.jersey.api.client.Client getClient()
@Nonnull public static com.sun.jersey.api.client.WebResource newResource(@Nullable String url, @Nullable 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 <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)
@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)
@Nonnull 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 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)
Copyright © 2003–2016 Atlassian. All rights reserved.