|
@@ -9,6 +9,7 @@ import cn.hutool.http.HttpUtil;
|
|
|
import cn.hutool.system.oshi.OshiUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.fdkankan.common.exception.BusinessException;
|
|
|
import com.fdkankan.common.util.CmdUtils;
|
|
|
import com.fdkankan.common.util.DateExtUtil;
|
|
|
import com.fdkankan.download.bean.ImageTypeDetail;
|
|
@@ -104,7 +105,7 @@ public class LaserService implements ILaserService {
|
|
|
if (!key.startsWith("/")) {
|
|
|
srcPath = "/" + key;
|
|
|
}
|
|
|
- this.downloadFile(laserResourceUrl + key, sourceLocal +
|
|
|
+ DownloadUtil.downloadFile(laserResourceUrl + key, sourceLocal +
|
|
|
File.separator + num +
|
|
|
File.separator + "www" +
|
|
|
File.separator + num + srcPath,1);
|
|
@@ -128,7 +129,7 @@ public class LaserService implements ILaserService {
|
|
|
if (StrUtil.isEmpty(FileUtil.extName(key)) || FileUtil.extName(key).equalsIgnoreCase("ply")) {
|
|
|
continue;
|
|
|
}
|
|
|
- this.downloadFile(laserResourceUrl + key, sourceLocal +
|
|
|
+ DownloadUtil.downloadFile(laserResourceUrl + key, sourceLocal +
|
|
|
File.separator + num +
|
|
|
File.separator + "www" +
|
|
|
File.separator + num +
|
|
@@ -218,20 +219,4 @@ public class LaserService implements ILaserService {
|
|
|
return FileUtil.file(moveZipPath);
|
|
|
|
|
|
}
|
|
|
- public void downloadFile(String url, String path,int index){
|
|
|
- File file = new File(path);
|
|
|
- if(!file.getParentFile().exists()){
|
|
|
- file.getParentFile().mkdirs();
|
|
|
- }
|
|
|
- try {
|
|
|
- DownloadUtil.downFile(url,path);
|
|
|
-// HttpUtil.downloadFileFromUrl(url,path);
|
|
|
- if(FileUtil.size(new File(path)) == 0 && index < 4){
|
|
|
- index++;
|
|
|
- this.downloadFile(url,path,index);
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- log.info("下载文件报错,url{},path:{}",url, path);
|
|
|
- }
|
|
|
- }
|
|
|
}
|