mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2025-04-05 17:37:49 +08:00
修复 forceUpdatedCache 属性设置,但是本地缓存文件不更新缺陷
Signed-off-by: lujiaming <1451771613@qq.com>
This commit is contained in:
parent
2cfd692171
commit
bbd7530f77
@ -124,11 +124,15 @@ public class DownloadUtils {
|
|||||||
if (!dirFile.exists() && !dirFile.mkdirs()) {
|
if (!dirFile.exists() && !dirFile.mkdirs()) {
|
||||||
logger.error("创建目录【{}】失败,可能是权限不够,请检查", fileDir);
|
logger.error("创建目录【{}】失败,可能是权限不够,请检查", fileDir);
|
||||||
}
|
}
|
||||||
// 文件已在本地存在,跳过文件下载
|
Boolean forceUpdatedCache = fileAttribute.forceUpdatedCache();
|
||||||
File realFile = new File(realPath);
|
//判断是否启用强制更新功能如果启用 文件必须重新下载
|
||||||
if (realFile.exists()) {
|
if (null == forceUpdatedCache || !forceUpdatedCache) {
|
||||||
fileAttribute.setSkipDownLoad(true);
|
// 文件已在本地存在,跳过文件下载
|
||||||
return "cunzhai";
|
File realFile = new File(realPath);
|
||||||
|
if (realFile.exists()) {
|
||||||
|
fileAttribute.setSkipDownLoad(true);
|
||||||
|
return "cunzhai"; //这里给的值是不能修改的 对应的是下载方法里面有个强制输出地址的
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return realPath;
|
return realPath;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user