Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
ldmap-download
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
王健
ldmap-download
Commits
6451f2b5
提交
6451f2b5
authored
4月 20, 2020
作者:
张航
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
进行了部分细节的优化
上级
50f31a5c
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
10 行增加
和
6 行删除
+10
-6
DownMapService.java
...a/com/comleader/ldmapdownload/service/DownMapService.java
+4
-3
HttpUtil.java
src/main/java/com/comleader/ldmapdownload/util/HttpUtil.java
+2
-0
httpclient.properties
src/main/resources/config/httpclient.properties
+2
-1
index.html
src/main/resources/static/index.html
+2
-2
没有找到文件。
src/main/java/com/comleader/ldmapdownload/service/DownMapService.java
浏览文件 @
6451f2b5
...
...
@@ -140,12 +140,12 @@ public class DownMapService {
for
(
int
i
=
0
;
i
<
DownMapService
.
schedule
;
i
++)
{
stringBuffer
.
append
(
"]"
);
}
stringBuffer
.
append
(
countSuccessFile
+
"/"
+
readyCountFile
);
stringBuffer
.
append
(
"\t"
+
countSuccessFile
+
"/"
+
readyCountFile
);
System
.
out
.
print
(
stringBuffer
);
}
},
200
,
200
);
// 主线程阻塞等待执行完成
// 主线程阻塞等待
下载
执行完成
for
(
Future
<
Integer
>
future
:
futures
)
{
if
(
DownMapService
.
stoped
||
!
session
.
isOpen
())
{
DownMapService
.
finished
=
true
;
...
...
@@ -261,10 +261,11 @@ public class DownMapService {
// 开始下载地图
if
(
file
!=
null
)
{
HttpUtil
.
downImageByGet
(
imgUrl
,
file
);
speed
++;
// 累计到下载速度上
}
speed
++;
// 累计到下载速度上
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
// 回滚
if
(
file
!=
null
&&
file
.
exists
())
{
file
.
delete
();
}
...
...
src/main/java/com/comleader/ldmapdownload/util/HttpUtil.java
浏览文件 @
6451f2b5
...
...
@@ -76,8 +76,10 @@ public class HttpUtil {
e
.
printStackTrace
();
}
// 累加总文件大小
if
(
file
!=
null
){
totalSize
+=
FileUtil
.
size
(
file
);
}
}
}
...
...
src/main/resources/config/httpclient.properties
浏览文件 @
6451f2b5
...
...
@@ -7,6 +7,6 @@ http.connectTimeout=60000
#从连接池中获取到连接的最长时间
http.connectionRequestTimeout
=
6000000
#数据传输的最长时间
http.socketTimeout
=
120
0000
http.socketTimeout
=
6
0000
#提交请求前测试连接是否可用
http.staleConnectionCheckEnabled
=
true
\ No newline at end of file
src/main/resources/static/index.html
浏览文件 @
6451f2b5
...
...
@@ -4,7 +4,7 @@
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"initial-scale=1.0, user-scalable=no, width=device-width"
>
<title>
G
M MapDownLoader
</title>
<title>
C
M MapDownLoader
</title>
<!-- jquery -->
<script
src=
"thirdLib/jq/jquery-3.3.1.min.js"
></script>
...
...
@@ -28,7 +28,7 @@
<div
id=
"container"
></div>
<div
class=
"input-card"
style=
"width: 32rem;"
>
<h3>
优
图下载器
</h3>
<h3>
领
图下载器
</h3>
<h4>
下载区域
</h4>
<div
class=
"input-item"
>
<div
class=
"input-item-prepend"
><span
class=
"input-item-text"
>
省市区
</span></div>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论