Browse Source

将获取文件的接口做额外的处理3

Yangzw 1 month ago
parent
commit
ce0a60f634

+ 2 - 2
feifan-framework/feifan-common/src/main/java/cn/newfeifan/mall/framework/common/util/servlet/ServletUtils.java

@@ -157,8 +157,8 @@ public class ServletUtils {
     public static File fileTransition(byte[] content) throws IOException{
         File file = new File("data/file/videoTest.mp4");
         if(!file.exists()){
-            log.info("=====创建文件");
-            file.mkdir();
+            boolean newFile = file.createNewFile();
+            log.info("=====创建文件yse or no:{}",newFile);
         }
         Files.write(Paths.get("data/file/videoTest.mp4"), content);
         return file;