Commit 00e4df5e authored by luzhuang's avatar luzhuang

修改

parent 32c90bb5
...@@ -651,7 +651,6 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -651,7 +651,6 @@ public class BChapterServiceImpl implements BChapterService {
@Override @Override
public String checkFileHeader(BFile bFile) { public String checkFileHeader(BFile bFile) {
String flag = "1";
String name = bFile.getVideoUrl().substring(bFile.getVideoUrl().lastIndexOf("/") + 1); String name = bFile.getVideoUrl().substring(bFile.getVideoUrl().lastIndexOf("/") + 1);
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);
...@@ -667,14 +666,10 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -667,14 +666,10 @@ public class BChapterServiceImpl implements BChapterService {
if (!line){ if (!line){
throw new ServiceException(ResultServiceEnums.FILE_UNREADABLE); throw new ServiceException(ResultServiceEnums.FILE_UNREADABLE);
} }
LogUtil.fileChangeLog("-----------------------后缀名相符-------------------------" + fileOld);
} }
return flag; return "1";
// Boolean line = CheckFileHeaderUtil.toCheck(getDownLoadUrl(bFile));
// if (!line) {
// throw new ServiceException(ResultServiceEnums.FILE_CHECK_ERROR);
// }
// return "1";
} }
......
...@@ -6,7 +6,7 @@ import java.io.FileInputStream; ...@@ -6,7 +6,7 @@ import java.io.FileInputStream;
@Slf4j @Slf4j
public class CheckFileHeaderUtil { public class CheckFileHeaderUtil {
public static void main(String[] args) { public static void main(String[] args) {
String filePath = "C:\\Users\\Administrator\\Desktop\\003.mp4"; String filePath = "D:\\recorded\\Python\\1.68.mp4";
System.out.println(toCheck(filePath)); System.out.println(toCheck(filePath));
} }
...@@ -72,7 +72,7 @@ public class CheckFileHeaderUtil { ...@@ -72,7 +72,7 @@ public class CheckFileHeaderUtil {
if(type.contains("89504E470D0A1A0A")) if(type.contains("89504E470D0A1A0A"))
return "png"; return "png";
if(type.contains("0000002066747")) if(type.substring(0,10).contains("000000"))
return "mp4"; return "mp4";
if(type.contains("4944330300000")) if(type.contains("4944330300000"))
......
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