Skip to content

Commit e553fab

Browse files
committed
Merge branch 'master' into dev
2 parents 454ef50 + b6e3ced commit e553fab

File tree

11 files changed

+32
-34
lines changed

11 files changed

+32
-34
lines changed

disconf-core/src/main/java/com/baidu/disconf/core/common/restful/impl/RestfulMgrImpl.java

+12-14
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public RestfulMgrImpl(RetryStrategy retryStrategy) {
5050
*/
5151
public <T> T getJsonData(Class<T> clazz, RemoteUrl remoteUrl, int retryTimes, int retrySleepSeconds)
5252
throws Exception {
53-
53+
Exception ex = null;
5454
for (URL url : remoteUrl.getUrls()) {
5555

5656
// 可重试的下载
@@ -63,7 +63,7 @@ public <T> T getJsonData(Class<T> clazz, RemoteUrl remoteUrl, int retryTimes, in
6363
return t;
6464

6565
} catch (Exception e) {
66-
66+
ex = e;
6767
try {
6868
Thread.sleep(1000);
6969
} catch (InterruptedException e1) {
@@ -72,7 +72,7 @@ public <T> T getJsonData(Class<T> clazz, RemoteUrl remoteUrl, int retryTimes, in
7272
}
7373
}
7474

75-
throw new Exception("cannot get: " + remoteUrl);
75+
throw new Exception("cannot get: " + remoteUrl, ex);
7676
}
7777

7878
/**
@@ -129,8 +129,8 @@ public String downloadFromServer(RemoteUrl remoteUrl, String fileName, String lo
129129
//
130130
// 判断是否下载失败
131131
//
132-
133-
if (!localFile.exists()) {
132+
133+
if (localFile == null || !localFile.exists()) {
134134
throw new Exception("target file cannot be found! " + fileName);
135135
}
136136

@@ -139,12 +139,10 @@ public String downloadFromServer(RemoteUrl remoteUrl, String fileName, String lo
139139
//
140140

141141
// 返回相对路径
142-
if (localFileDir != null) {
143-
String relativePathString = OsUtil.getRelativePath(localFile, new File(localFileDir));
144-
if (relativePathString != null) {
145-
if (new File(relativePathString).isFile()) {
146-
return relativePathString;
147-
}
142+
String relativePathString = OsUtil.getRelativePath(localFile, new File(localFileDir));
143+
if (relativePathString != null) {
144+
if (new File(relativePathString).isFile()) {
145+
return relativePathString;
148146
}
149147
}
150148

@@ -218,7 +216,7 @@ private File transfer2SpecifyDir(File srcFile, String copy2TargetDirPath, String
218216
*/
219217
private Object retry4ConfDownload(RemoteUrl remoteUrl, File localTmpFile, int retryTimes, int sleepSeconds)
220218
throws Exception {
221-
219+
Exception ex = null;
222220
for (URL url : remoteUrl.getUrls()) {
223221

224222
// 可重试的下载
@@ -229,7 +227,7 @@ private Object retry4ConfDownload(RemoteUrl remoteUrl, File localTmpFile, int re
229227
return retryStrategy.retry(unreliableImpl, retryTimes, sleepSeconds);
230228

231229
} catch (Exception e) {
232-
230+
ex = e;
233231
try {
234232
Thread.sleep(1000);
235233
} catch (InterruptedException e1) {
@@ -238,7 +236,7 @@ private Object retry4ConfDownload(RemoteUrl remoteUrl, File localTmpFile, int re
238236
}
239237
}
240238

241-
throw new Exception("download failed.");
239+
throw new Exception("download failed.", ex);
242240
}
243241

244242
}

disconf-web/html/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@
116116
<div class="sep10"></div>
117117
<span>分布式配置管理平台</span>
118118
<div class="sep10"></div>
119-
<span class="myfade">Theme by <a href="http://django-china.cn/" target="_blank">Django中国社区</a>
119+
<span class="myfade">Theme by <a href="http://sov5.com/" target="_blank">Sov5搜索</a>
120120
Power by 百度程序化广告交易工程平台技术部,
121-
Copyright &copy; 2014 </span>
121+
Copyright &copy; 2014~2016 </span>
122122
</div>
123123
</div>
124124
</div>

disconf-web/html/login.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ <h2>登录</h2>
147147
<div class="sep10"></div>
148148
<span>分布式配置管理平台</span>
149149
<div class="sep10"></div>
150-
<span class="myfade">Theme by <a href="http://django-china.cn/" target="_blank">Django中国社区</a>
150+
<span class="myfade">Theme by <a href="http://sov5.com/" target="_blank">Sov5搜索</a>
151151
Power by 百度程序化广告交易工程平台技术部,
152-
Copyright &copy; 2014 </span>
152+
Copyright &copy; 2014~2016 </span>
153153
</div>
154154
</div>
155155
</div>

disconf-web/html/main.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@
194194
<div class="sep10"></div>
195195
<span>分布式配置管理平台</span>
196196
<div class="sep10"></div>
197-
<span class="myfade">Theme by <a href="http://django-china.cn/" target="_blank">Django中国社区</a>
197+
<span class="myfade">Theme by <a href="http://sov5.com/" target="_blank">Sov5搜索</a>
198198
Power by 百度程序化广告交易工程平台技术部,
199-
Copyright &copy; 2014 </span>
199+
Copyright &copy; 2014~2016 </span>
200200
</div>
201201
</div>
202202
</div>

disconf-web/html/modifyFile.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ <h2 class="autoPush-detail-title">配置文件修改</h2>
245245
<div class="sep10"></div>
246246
<span>分布式配置管理平台</span>
247247
<div class="sep10"></div>
248-
<span class="myfade">Theme by <a href="http://django-china.cn/" target="_blank">Django中国社区</a>
248+
<span class="myfade">Theme by <a href="http://sov5.com/" target="_blank">Sov5搜索</a>
249249
Power by 百度程序化广告交易工程平台技术部,
250-
Copyright &copy; 2014 </span>
250+
Copyright &copy; 2014~2016 </span>
251251
</div>
252252
</div>
253253
</div>

disconf-web/html/modifyItem.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ <h2 class="autoPush-detail-title">配置项修改</h2>
186186
<div class="sep10"></div>
187187
<span>分布式配置管理平台</span>
188188
<div class="sep10"></div>
189-
<span class="myfade">Theme by <a href="http://django-china.cn/" target="_blank">Django中国社区</a>
189+
<span class="myfade">Theme by <a href="http://sov5.com/" target="_blank">Sov5搜索</a>
190190
Power by 百度程序化广告交易工程平台技术部,
191-
Copyright &copy; 2014 </span>
191+
Copyright &copy; 2014~2016 </span>
192192
</div>
193193
</div>
194194
</div>

disconf-web/html/modifypassword.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ <h2 class="autoPush-detail-title">修改密码</h2>
156156
<div class="sep10"></div>
157157
<span>分布式配置管理平台</span>
158158
<div class="sep10"></div>
159-
<span class="myfade">Theme by <a href="http://django-china.cn/" target="_blank">Django中国社区</a>
159+
<span class="myfade">Theme by <a href="http://sov5.com/" target="_blank">Sov5搜索</a>
160160
Power by 百度程序化广告交易工程平台技术部,
161-
Copyright &copy; 2014 </span>
161+
Copyright &copy; 2014~2016 </span>
162162
</div>
163163
</div>
164164
</div>

disconf-web/html/newapp.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ <h2 class="autoPush-detail-title">新建APP</h2>
158158
<div class="sep10"></div>
159159
<span>分布式配置管理平台</span>
160160
<div class="sep10"></div>
161-
<span class="myfade">Theme by <a href="http://django-china.cn/" target="_blank">Django中国社区</a>
161+
<span class="myfade">Theme by <a href="http://sov5.com/" target="_blank">Sov5搜索</a>
162162
Power by 百度程序化广告交易工程平台技术部,
163-
Copyright &copy; 2014 </span>
163+
Copyright &copy; 2014~2016 </span>
164164
</div>
165165
</div>
166166
</div>

disconf-web/html/newconfig_file.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ <h2 class="autoPush-detail-title">新建配置文件</h2>
240240
<div class="sep10"></div>
241241
<span>分布式配置管理平台</span>
242242
<div class="sep10"></div>
243-
<span class="myfade">Theme by <a href="http://django-china.cn/" target="_blank">Django中国社区</a>
243+
<span class="myfade">Theme by <a href="http://sov5.com/" target="_blank">Sov5搜索</a>
244244
Power by 百度程序化广告交易工程平台技术部,
245-
Copyright &copy; 2014 </span>
245+
Copyright &copy; 2014~2016 </span>
246246
</div>
247247
</div>
248248
</div>

disconf-web/html/newconfig_item.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ <h2 class="autoPush-detail-title"> 新建配置项</h2>
182182
<div class="sep10"></div>
183183
<span>分布式配置管理平台</span>
184184
<div class="sep10"></div>
185-
<span class="myfade">Theme by <a href="http://django-china.cn/" target="_blank">Django中国社区</a>
185+
<span class="myfade">Theme by <a href="http://sov5.com/" target="_blank">Sov5搜索</a>
186186
Power by 百度程序化广告交易工程平台技术部,
187-
Copyright &copy; 2014 </span>
187+
Copyright &copy; 2014~2016 </span>
188188
</div>
189189
</div>
190190
</div>

disconf-web/html/unitTpl/foot.html.tpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
<div class="sep10"></div>
1212
<span>分布式配置管理平台</span>
1313
<div class="sep10"></div>
14-
<span class="myfade">Theme by <a href="http://django-china.cn/" target="_blank">Django中国社区</a>,
14+
<span class="myfade">Theme by <a href="http://sov5.com/" target="_blank">Sov5搜索</a>,
1515
Power by 百度程序化广告交易工程平台技术部,
16-
Copyright &copy; 2014 </span>
16+
Copyright &copy; 2014~2016 </span>
1717
</div>
1818
</div>
1919
</div>

0 commit comments

Comments
 (0)