Commit dab465cf authored by libin's avatar libin

上传包的修改

parent d3bfee46
......@@ -27,6 +27,9 @@ public class FileUploadServiceImpl implements FileUploadService {
@Value("${universal.url}")
private String xx_url ;
private static final String APK_SUFFIX=".apk";
private static final String APK_NAME="xxfc.apk";
@Override
public ObjectRestResponse handlerUpload(MultipartFile zipFile,String password,String prefix)throws Exception {
if (null == zipFile) {
......@@ -66,15 +69,14 @@ public class FileUploadServiceImpl implements FileUploadService {
String filename = path;
path=xx_url+"/"+prefix+"/"+path;
log.info("文件名:{}",path);
if (path.contains(".apk")){
if (filename.contains(APK_SUFFIX)){
Runtime runtime = Runtime.getRuntime();
log.info("执行删除xxfc.apk");
//删除包
runtime.exec("rm -rf "+uploadPath+"/xxfc.apk");
runtime.exec("rm -rf "+uploadPath+APK_NAME);
log.info("执行复制上传包为xxfc.apk");
//复制包
runtime.exec("cp -f "+uploadPath+"/"+filename+" "+uploadPath+"/xxfc.apk");
runtime.exit(0);
runtime.exec("cp -f "+uploadPath+"/"+filename+" "+uploadPath+APK_NAME);
}
return ObjectRestResponse.succ(path);
}else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment