Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
50c5602b
Commit
50c5602b
authored
Feb 22, 2023
by
284718418@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文件存储地址配置切换
parent
e788c269
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
src/main/java/cn/timer/api/utils/aliyun/OSSUtil.java
+12
-0
No files found.
src/main/java/cn/timer/api/utils/aliyun/OSSUtil.java
View file @
50c5602b
...
@@ -247,6 +247,18 @@ public class OSSUtil {
...
@@ -247,6 +247,18 @@ public class OSSUtil {
return
ResultUtil
.
data
(
reader
,
"下载成功"
);
return
ResultUtil
.
data
(
reader
,
"下载成功"
);
}
}
public
InputStream
downloadFileInputStream
(
String
objectName
)
{
// 创建OSSClient实例。
OSS
ossClient
=
new
OSSClientBuilder
().
build
(
endpoint
,
accessKeyId
,
accessKeySecret
);
// ossObject包含文件所在的存储空间名称、文件名称、文件元信息以及一个输入流。
OSSObject
ossObject
=
ossClient
.
getObject
(
bucketName
,
objectName
);
// 关闭OSSClient。
//ossClient.shutdown();
return
ossObject
.
getObjectContent
();
}
/**
/**
* 文件输入流批量上传
* 文件输入流批量上传
*
*
...
...
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