Commit c3c307fd authored by zhangqingle's avatar zhangqingle

修改文件可读

parent 2a888886
......@@ -717,18 +717,19 @@ public class BChapterServiceImpl implements BChapterService {
String filePath = global.getBASE_UPLOAD_SERVER_LOCATION() + global.getCOURSE_LOCATION() + File.separator + "temp";
File file = new File(filePath);
File fileOld = new File(filePath + File.separator + name);
String path;
if (fileOld.exists()) {
LogUtil.fileChangeLog("------------------文件名重复-------------------------" + fileOld);
throw new ServiceException(ResultServiceEnums.DUP_FILE);
path = fileOld.getPath();
} else {
LogUtil.fileChangeLog("------------------下载-------------------------" + fileOld);
String downLoadName = downLoadFile(bFile, file, filePath);
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())){
FileReadableUtil.imgReadable(filePath + File.separator + downLoadName);
FileReadableUtil.imgReadable(path);
}else {
FileReadableUtil.fileReadable(filePath + File.separator + downLoadName, fileMaxSize, fileMaxPages);
}
FileReadableUtil.fileReadable(path, fileMaxSize, fileMaxPages);
}
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