Make sure we clean all the files below the .webgoat dir
This commit is contained in:
parent
a484467419
commit
e9ad20cb30
@ -24,6 +24,10 @@ public class CleanupLocalProgressFiles {
|
|||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void clean() {
|
public void clean() {
|
||||||
File dir = new File(webgoatHome);
|
File dir = new File(webgoatHome);
|
||||||
|
//do it safe, check whether the subdir mongodb is available as subdirectory
|
||||||
|
File[] mongoDir = dir.listFiles(f -> f.isDirectory() && f.getName().contains("mongodb"));
|
||||||
|
if (mongoDir != null && mongoDir.length == 1) {
|
||||||
FileSystemUtils.deleteRecursively(dir);
|
FileSystemUtils.deleteRecursively(dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user