Skip to content

Commit

Permalink
增加测试数据文件夹创建逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
brianxcli authored Jan 24, 2018
1 parent 7951dee commit 9188a63
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,24 @@ private static void toDataJs(File des) {
private static void toDataJs() {
File des = isWX ? new File(getResultDataFilePath)
: new File(resultDataFilePath);
toDataJs(des);
if (toCreateFileDir(des)) {
toDataJs(des);
} else {
System.out.println("ErrorData: 文件创建失败,请开启系统读写权限后重试");
}
}

private static boolean toCreateFileDir(File des) {
try {
if (des.exists()) {
des.delete();
}
des.getParentFile().mkdirs();
des.createNewFile();
return true;
} catch (IOException e) {
e.printStackTrace();
return false;
}
}
}

0 comments on commit 9188a63

Please sign in to comment.