public class ApiInvoker extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.apache.sling.commons.mime.internal.MimeTypeServiceImpl |
mimeTypeService |
| Constructor and Description |
|---|
ApiInvoker() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDefaultHeader(String key,
String value) |
static Object |
deserialize(String json,
String containerType,
Class cls) |
static String |
encodeURI(String uri) |
static String |
encodeURIComponent(String str) |
String |
escapeString(String str) |
static ApiInvoker |
getInstance() |
<T> T |
invokeAPI(String host,
String path,
String method,
Map<String,String> queryParams,
Object body,
Map<String,String> headerParams,
Class<T> returnType) |
static String |
readAsDataURL(File file)
Read file contents into String according to http://en.wikipedia.org/wiki/Data_URI_scheme#Format
|
static String |
readAsDataURL(File file,
String contentType) |
static String |
readAsDataURL(InputStream is,
String contentType) |
static String |
serialize(Object obj) |
void |
setRequestSigner(RequestSigner signer) |
public static org.apache.sling.commons.mime.internal.MimeTypeServiceImpl mimeTypeService
public static ApiInvoker getInstance()
public void setRequestSigner(RequestSigner signer)
public static Object deserialize(String json, String containerType, Class cls) throws ApiException
ApiExceptionpublic static String serialize(Object obj) throws ApiException
ApiExceptionpublic <T> T invokeAPI(String host, String path, String method, Map<String,String> queryParams, Object body, Map<String,String> headerParams, Class<T> returnType) throws ApiException
ApiExceptionpublic static String readAsDataURL(File file) throws IOException
file - IOExceptionFileNotFoundExceptionExceptionpublic static String readAsDataURL(File file, String contentType) throws IOException
IOExceptionpublic static String readAsDataURL(InputStream is, String contentType) throws IOException
IOExceptionCopyright © 2012 GroupDocs. All Rights Reserved.