Package org.alfresco.rest.core.v0
Class APIUtils
- java.lang.Object
-
- org.alfresco.rest.core.v0.APIUtils
-
public class APIUtils extends Object
Helper methods for use with REST APIs.- Since:
- 2.6
- Author:
- Tom Page
-
-
Field Summary
Fields Modifier and Type Field Description static DateTimeFormatterISO_INSTANT_FORMATTERThe 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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
ISO_INSTANT_FORMATTER
public static final DateTimeFormatter 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 Detail
-
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
public static String extractErrorMessageFromHttpResponse(org.apache.http.HttpResponse httpResponse)
Util method to extract the message string from the HTTP response- Parameters:
httpResponse- http response- Returns:
- error message from the http response
-
-