|
@@ -237,14 +237,15 @@ public class SceneUploadServiceImpl extends ServiceImpl<ISceneUploadMapper, Scen
|
|
File oldFile = File.createTempFile(UUID.randomUUID().toString() ,extName);
|
|
File oldFile = File.createTempFile(UUID.randomUUID().toString() ,extName);
|
|
file.transferTo(oldFile);
|
|
file.transferTo(oldFile);
|
|
|
|
|
|
- File destFile = File.createTempFile(UUID.randomUUID().toString() ,extName);
|
|
|
|
- CreateObjUtil.formatMp4(oldFile.getPath(), destFile.getPath());
|
|
|
|
|
|
+// File destFile = File.createTempFile(UUID.randomUUID().toString() ,extName);
|
|
|
|
+ String descFilePath = ConstantFilePath.SCENE_V4_PATH + "abcd/" + file.getOriginalFilename();
|
|
|
|
+ CreateObjUtil.formatMp4(oldFile.getPath(), descFilePath);
|
|
|
|
|
|
- if(!cn.hutool.core.io.FileUtil.exist(destFile.getPath())){
|
|
|
|
|
|
+ if(!cn.hutool.core.io.FileUtil.exist(descFilePath)){
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5038);
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5038);
|
|
}
|
|
}
|
|
|
|
|
|
- File outFile = new File(destFile.getPath());
|
|
|
|
|
|
+ File outFile = new File(descFilePath);
|
|
//定义处理流
|
|
//定义处理流
|
|
try(
|
|
try(
|
|
InputStream inputStream = new BufferedInputStream(new FileInputStream(outFile));
|
|
InputStream inputStream = new BufferedInputStream(new FileInputStream(outFile));
|
|
@@ -267,8 +268,15 @@ public class SceneUploadServiceImpl extends ServiceImpl<ISceneUploadMapper, Scen
|
|
//刷新输出流,否则不会写出数据
|
|
//刷新输出流,否则不会写出数据
|
|
outputStream.flush();
|
|
outputStream.flush();
|
|
}finally {
|
|
}finally {
|
|
- FileUtil.delFile(oldFile.getPath());
|
|
|
|
- FileUtil.delFile(destFile.getPath());
|
|
|
|
|
|
+// FileUtil.delFile(oldFile.getPath());
|
|
|
|
+// FileUtil.delFile(destFile.getPath());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public static void main(String[] args) {
|
|
|
|
+ File file = new File("C:\\Users\\4dage\\Desktop\\screencap.mp4");
|
|
|
|
+ System.out.println(file.length());
|
|
|
|
+ File file2 = new File("C:\\Users\\4dage\\Desktop\\abc.mp4");
|
|
|
|
+ System.out.println(file2.length());
|
|
|
|
+ }
|
|
}
|
|
}
|