Commit d0fe3155 authored by lu's avatar lu

Merge remote-tracking branch 'aliyun/master-1.0.1' into meiteng

parents 80489216 c3c307fd
...@@ -717,18 +717,19 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -717,18 +717,19 @@ public class BChapterServiceImpl implements BChapterService {
String filePath = global.getBASE_UPLOAD_SERVER_LOCATION() + global.getCOURSE_LOCATION() + File.separator + "temp"; String filePath = global.getBASE_UPLOAD_SERVER_LOCATION() + global.getCOURSE_LOCATION() + File.separator + "temp";
File file = new File(filePath); File file = new File(filePath);
File fileOld = new File(filePath + File.separator + name); File fileOld = new File(filePath + File.separator + name);
String path;
if (fileOld.exists()) { if (fileOld.exists()) {
LogUtil.fileChangeLog("------------------文件名重复-------------------------" + fileOld); path = fileOld.getPath();
throw new ServiceException(ResultServiceEnums.DUP_FILE);
} else { } else {
LogUtil.fileChangeLog("------------------下载-------------------------" + fileOld); LogUtil.fileChangeLog("------------------下载-------------------------" + fileOld);
String downLoadName = downLoadFile(bFile, file, filePath); String downLoadName = downLoadFile(bFile, file, filePath);
LogUtil.fileChangeLog("------------------判断可读-------------------------" + fileOld); LogUtil.fileChangeLog("------------------判断可读-------------------------" + fileOld);
path = filePath + File.separator + downLoadName;
}
if ("7".equals(bFile.getType()) || "8".equals(bFile.getType()) || "9".equals(bFile.getType()) || "10".equals(bFile.getType())){ if ("7".equals(bFile.getType()) || "8".equals(bFile.getType()) || "9".equals(bFile.getType()) || "10".equals(bFile.getType())){
FileReadableUtil.imgReadable(filePath + File.separator + downLoadName); FileReadableUtil.imgReadable(path);
}else { }else {
FileReadableUtil.fileReadable(filePath + File.separator + downLoadName, fileMaxSize, fileMaxPages); FileReadableUtil.fileReadable(path, fileMaxSize, fileMaxPages);
}
} }
return flag; return flag;
} }
......
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