refine exception process

This commit is contained in:
327135569 2021-02-02 15:45:56 +08:00
parent 581aaf74f7
commit 7fd0ad99ac
1 changed files with 43 additions and 39 deletions

View File

@ -31,10 +31,14 @@ public class SaveOriginalApplicationNameTask implements Runnable {
private void ensureDstFileCreated() {
File dstParentFile = new File(dstFilePath);
if (!dstParentFile.getParentFile().getParentFile().exists()) {
dstParentFile.getParentFile().getParentFile().mkdirs();
if(!dstParentFile.getParentFile().getParentFile().mkdirs()){
throw new IllegalStateException("mkdir fail");
}
}
if (!dstParentFile.getParentFile().exists()) {
dstParentFile.getParentFile().mkdirs();
if(!dstParentFile.getParentFile().mkdirs()){
throw new IllegalStateException("mkdir fail");
}
}
}
}