Commit c3c307fd authored by zhangqingle's avatar zhangqingle

修改文件可读

parent 2a888886
...@@ -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);
if ("7".equals(bFile.getType()) || "8".equals(bFile.getType()) || "9".equals(bFile.getType()) || "10".equals(bFile.getType())){ path = filePath + File.separator + downLoadName;
FileReadableUtil.imgReadable(filePath + File.separator + downLoadName); }
}else { if ("7".equals(bFile.getType()) || "8".equals(bFile.getType()) || "9".equals(bFile.getType()) || "10".equals(bFile.getType())){
FileReadableUtil.fileReadable(filePath + File.separator + downLoadName, fileMaxSize, fileMaxPages); FileReadableUtil.imgReadable(path);
} }else {
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