|
@@ -1,11 +1,14 @@
|
|
package cn.com.qmth.examcloud.web.config;
|
|
package cn.com.qmth.examcloud.web.config;
|
|
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
|
|
+import java.io.IOException;
|
|
|
|
|
|
|
|
+import org.apache.commons.io.FileUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
+import cn.com.qmth.examcloud.commons.exception.ExamCloudRuntimeException;
|
|
import cn.com.qmth.examcloud.commons.util.PathUtil;
|
|
import cn.com.qmth.examcloud.commons.util.PathUtil;
|
|
import cn.com.qmth.examcloud.web.support.ClasspathHelper;
|
|
import cn.com.qmth.examcloud.web.support.ClasspathHelper;
|
|
|
|
|
|
@@ -42,6 +45,18 @@ public class SystemProperties {
|
|
tempDataDir = PathUtil.getCanonicalPath(new File(path));
|
|
tempDataDir = PathUtil.getCanonicalPath(new File(path));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ try {
|
|
|
|
+ FileUtils.forceMkdir(new File(dataDir));
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
+ throw new ExamCloudRuntimeException("fail to make data dir. path=" + dataDir);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ FileUtils.forceMkdir(new File(tempDataDir));
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
+ throw new ExamCloudRuntimeException("fail to make temp data dir. path=" + tempDataDir);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
public String getDataDir() {
|
|
public String getDataDir() {
|