Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
谢明辉
/
oss-update-application
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e3309767
authored
May 16, 2019
by
谢明辉
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
下载指定文件
1 parent
f61c8909
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletions
src/main/java/com/vion/Application.java
src/main/resources/application-pro.properties
src/main/java/com/vion/Application.java
View file @
e330976
...
...
@@ -56,6 +56,9 @@ public class Application implements CommandLineRunner {
private
String
prefix
;
@Value
((
"${serialnumStr:}"
))
private
String
serialnumStr
;
@Value
(
"${file_path:}"
)
private
String
filePath
;
@Override
public
void
run
(
String
...
args
)
throws
Exception
{
...
...
@@ -70,6 +73,18 @@ public class Application implements CommandLineRunner {
// System.exit(2);
// }
if
(!
""
.
equals
(
filePath
))
{
try
{
File
file
=
new
File
(
"d:\\"
+
filePath
.
replace
(
"\\"
,
"/"
));
ossClientEntity
.
getOssClient
().
getObject
(
new
GetObjectRequest
(
ossClientEntity
.
getBucket
(),
filePath
),
file
);
}
catch
(
Exception
e
)
{
System
.
exit
(
0
);
}
System
.
exit
(
0
);
}
List
<
String
>
filePathList
=
new
ArrayList
<>();
if
(!
serialnumStr
.
isEmpty
())
{
String
[]
serialnums
=
serialnumStr
.
split
(
","
);
...
...
src/main/resources/application-pro.properties
View file @
e330976
...
...
@@ -26,6 +26,10 @@ date.end=20180825
flag
=
mysql
server.port
=
8888
##########
prefix
=
picture/body/20190402/
serialnumStr
=
0269-F060-E72E-52FE-01,00FE-63D0-0345-CA16-01
#### assigned to a specific file\u2018s path
file_path
=
staff/face/upload/6450f60a-5f6f-408f-a75a-b417cdc6302d.jpg
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment