Package org.alfresco.rest.core.v0
Class APIUtils
java.lang.Object
org.alfresco.rest.core.v0.APIUtils
Helper methods for use with REST APIs.
- Since:
- 2.6
- Author:
- Tom Page
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DateTimeFormatterThe ISO instant formatter that formats or parses an instant in UTC, such as '2011-12-03T10:15:305Z' similar withDateTimeFormatter.ISO_INSTANT, but with only 3 nanoseconds -
Method Summary
Modifier and TypeMethodDescriptionstatic org.json.JSONObjectconvertHTTPResponseToJSON(org.apache.http.HttpResponse httpResponse) Extract the body of a HTTP response as a JSON object.static StringextractErrorMessageFromHttpResponse(org.apache.http.HttpResponse httpResponse) Util method to extract the message string from the HTTP response
-
Field Details
-
ISO_INSTANT_FORMATTER
The ISO instant formatter that formats or parses an instant in UTC, such as '2011-12-03T10:15:305Z' similar withDateTimeFormatter.ISO_INSTANT, but with only 3 nanoseconds
-
-
Method Details
-
convertHTTPResponseToJSON
public static org.json.JSONObject convertHTTPResponseToJSON(org.apache.http.HttpResponse httpResponse) Extract the body of a HTTP response as a JSON object.- Parameters:
httpResponse- The HTTP response.- Returns:
- A JSON representation of the object.
-
extractErrorMessageFromHttpResponse
Util method to extract the message string from the HTTP response- Parameters:
httpResponse- http response- Returns:
- error message from the http response
-