Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poc
poc-api
Commits
fddacb73
Commit
fddacb73
authored
Jan 15, 2025
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:配置网页读取超时
parent
03a0ab73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
DocumentLoad.java
src/main/java/cn/com/poc/common/utils/DocumentLoad.java
+4
-0
No files found.
src/main/java/cn/com/poc/common/utils/DocumentLoad.java
View file @
fddacb73
...
@@ -33,6 +33,10 @@ public class DocumentLoad {
...
@@ -33,6 +33,10 @@ public class DocumentLoad {
try
{
try
{
// 创建 资源符对象 连接
// 创建 资源符对象 连接
URLConnection
conn
=
new
URL
(
url
).
openConnection
();
URLConnection
conn
=
new
URL
(
url
).
openConnection
();
// 设置连接超时时间,单位毫秒
conn
.
setConnectTimeout
(
5000
);
// 设置读取超时时间,单位毫秒
conn
.
setReadTimeout
(
15000
);
// 获取输入流
// 获取输入流
InputStream
inputStream
=
conn
.
getInputStream
();
InputStream
inputStream
=
conn
.
getInputStream
();
// 缓冲区,读取输入流内容,64KB
// 缓冲区,读取输入流内容,64KB
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment