public class RestfulMgrImpl extends Object implements RestfulMgr
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
LOGGER |
| Constructor and Description |
|---|
RestfulMgrImpl(RetryStrategy retryStrategy) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
String |
downloadFromServer(RemoteUrl remoteUrl,
String fileName,
String localFileDir,
String localFileDirTemp,
String targetDirPath,
boolean enableLocalDownloadDirInClassPath,
int retryTimes,
int retrySleepSeconds) |
<T> T |
getJsonData(Class<T> clazz,
RemoteUrl remoteUrl,
int retryTimes,
int retrySleepSeconds)
获取JSON数据
|
public RestfulMgrImpl(RetryStrategy retryStrategy)
public <T> T getJsonData(Class<T> clazz, RemoteUrl remoteUrl, int retryTimes, int retrySleepSeconds) throws Exception
getJsonData in interface RestfulMgrclazz - remoteUrl - Exceptionpublic String downloadFromServer(RemoteUrl remoteUrl, String fileName, String localFileDir, String localFileDirTemp, String targetDirPath, boolean enableLocalDownloadDirInClassPath, int retryTimes, int retrySleepSeconds) throws Exception
downloadFromServer in interface RestfulMgrremoteUrl - 远程地址fileName - 文件名localFileDir - 本地文件地址targetDirPath - 下载完后,配置文件指定的文件目录retryTimes - retrySleepSeconds - Exceptionpublic void close()
close in interface RestfulMgrCopyright © 2015–2016 Baidu. All rights reserved.