|
@@ -577,14 +577,12 @@ public class KmtExerciseQuestionDealServiceImpl implements KmtExerciseQuestionDe
|
|
|
//如果目录不存在,新建目录,如果存在,判断文件是否存在
|
|
|
String dir = filePath.substring(0, filePath.lastIndexOf("/") + 1);
|
|
|
File dirFile = new File(dir);
|
|
|
- if (dirFile.isDirectory()) {
|
|
|
- if (!dirFile.exists()){
|
|
|
- dirFile.mkdirs();
|
|
|
- }
|
|
|
- File file = new File(filePath);
|
|
|
- if (!file.exists()){
|
|
|
- OSSUtils.downloadFile(filePath, relatePath.substring(1));
|
|
|
- }
|
|
|
+ if (!dirFile.exists()){
|
|
|
+ dirFile.mkdirs();
|
|
|
+ }
|
|
|
+ File file = new File(filePath);
|
|
|
+ if (!file.exists()){
|
|
|
+ OSSUtils.downloadFile(filePath, relatePath.substring(1));
|
|
|
}
|
|
|
} else {
|
|
|
logger.error("图片路径不存在 = {}", relatePath);
|