public class AntchainUtils extends Object
| 构造器和说明 |
|---|
AntchainUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Integer |
addInteger(Integer num,
Integer num1)
add two integer
|
static String |
formatDate(Date date)
date to string
|
static String |
getNonce()
Get nonce
|
static String |
getSignature(Map<String,String> signedParams,
String secret)
Calculate signature according to signedParams and secret
|
static String |
getTimestamp()
Get timestamp
|
static Boolean |
hasError(String res,
String secret)
Judge if the api called success or not
|
static boolean |
isSuccess(String resultCode,
String successCode)
Judge upload is ok
|
static Date |
parseDate(String date)
string to date
|
static Map<String,String> |
parseUploadHeaders(Object headers)
Parse headers into map[string]string
|
static void |
putObject(InputStream item,
Map<String,String> headers,
String urlPath)
Upload item with urlPath
|
static String |
urlEncode(String value)
URL encode
|
public static String getTimestamp() throws Exception
Exceptionpublic static Boolean hasError(String res, String secret) throws Exception
res - the responseExceptionpublic static String getSignature(Map<String,String> signedParams, String secret) throws Exception
signedParams - the signed stringsecret - the accesskey secretExceptionpublic static String urlEncode(String value)
value - the response stringpublic static void putObject(InputStream item, Map<String,String> headers, String urlPath) throws Exception
item - the fileurlPath - the upload urlExceptionpublic static Map<String,String> parseUploadHeaders(Object headers) throws Exception
headers - the target headersExceptionpublic static String getNonce()
public static boolean isSuccess(String resultCode, String successCode)
Copyright © 2021. All rights reserved.