Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
dab465cf
Commit
dab465cf
authored
Aug 31, 2019
by
libin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传包的修改
parent
d3bfee46
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
FileUploadServiceImpl.java
...latform/universal/service/impl/FileUploadServiceImpl.java
+6
-4
No files found.
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/impl/FileUploadServiceImpl.java
View file @
dab465cf
...
@@ -27,6 +27,9 @@ public class FileUploadServiceImpl implements FileUploadService {
...
@@ -27,6 +27,9 @@ public class FileUploadServiceImpl implements FileUploadService {
@Value
(
"${universal.url}"
)
@Value
(
"${universal.url}"
)
private
String
xx_url
;
private
String
xx_url
;
private
static
final
String
APK_SUFFIX
=
".apk"
;
private
static
final
String
APK_NAME
=
"xxfc.apk"
;
@Override
@Override
public
ObjectRestResponse
handlerUpload
(
MultipartFile
zipFile
,
String
password
,
String
prefix
)
throws
Exception
{
public
ObjectRestResponse
handlerUpload
(
MultipartFile
zipFile
,
String
password
,
String
prefix
)
throws
Exception
{
if
(
null
==
zipFile
)
{
if
(
null
==
zipFile
)
{
...
@@ -66,15 +69,14 @@ public class FileUploadServiceImpl implements FileUploadService {
...
@@ -66,15 +69,14 @@ public class FileUploadServiceImpl implements FileUploadService {
String
filename
=
path
;
String
filename
=
path
;
path
=
xx_url
+
"/"
+
prefix
+
"/"
+
path
;
path
=
xx_url
+
"/"
+
prefix
+
"/"
+
path
;
log
.
info
(
"文件名:{}"
,
path
);
log
.
info
(
"文件名:{}"
,
path
);
if
(
path
.
contains
(
".apk"
)){
if
(
filename
.
contains
(
APK_SUFFIX
)){
Runtime
runtime
=
Runtime
.
getRuntime
();
Runtime
runtime
=
Runtime
.
getRuntime
();
log
.
info
(
"执行删除xxfc.apk"
);
log
.
info
(
"执行删除xxfc.apk"
);
//删除包
//删除包
runtime
.
exec
(
"rm -rf "
+
uploadPath
+
"/xxfc.apk"
);
runtime
.
exec
(
"rm -rf "
+
uploadPath
+
APK_NAME
);
log
.
info
(
"执行复制上传包为xxfc.apk"
);
log
.
info
(
"执行复制上传包为xxfc.apk"
);
//复制包
//复制包
runtime
.
exec
(
"cp -f "
+
uploadPath
+
"/"
+
filename
+
" "
+
uploadPath
+
"/xxfc.apk"
);
runtime
.
exec
(
"cp -f "
+
uploadPath
+
"/"
+
filename
+
" "
+
uploadPath
+
APK_NAME
);
runtime
.
exit
(
0
);
}
}
return
ObjectRestResponse
.
succ
(
path
);
return
ObjectRestResponse
.
succ
(
path
);
}
else
{
}
else
{
...
...
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