deason 3 år sedan
förälder
incheckning
e3ed6631fe

+ 16 - 0
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/util/FileUtil.java

@@ -75,4 +75,20 @@ public class FileUtil {
         return matcher.find();
     }
 
+    /**
+     * 创建文件目录
+     */
+    public static boolean makeDirs(String dirPath) {
+        if (StringUtils.isEmpty(dirPath)) {
+            return false;
+        }
+
+        File dir = new File(dirPath);
+        if (!dir.exists()) {
+            return dir.mkdirs();
+        }
+
+        return true;
+    }
+
 }