Polish and reinstate usage of FileSystemUtils.deleteRecursively

Closes gh-9942
This commit is contained in:
Andy Wilkinson
2017-09-21 12:03:51 +01:00
parent c4aba91c47
commit c3bc32db02
2 changed files with 8 additions and 15 deletions

View File

@@ -42,12 +42,10 @@ public class JarFileRemoteApplicationLauncher extends RemoteApplicationLauncher
@Override
protected String createApplicationClassPath() throws Exception {
File appDirectory = new File("target/app");
if (appDirectory.isDirectory()) {
FileSystemUtils.deleteRecursively(appDirectory.toPath());
if (appDirectory.isDirectory()) {
throw new IllegalStateException(
"Failed to delete '" + appDirectory.getAbsolutePath() + "'");
}
if (appDirectory.isDirectory()
&& !FileSystemUtils.deleteRecursively(appDirectory.toPath())) {
throw new IllegalStateException(
"Failed to delete '" + appDirectory.getAbsolutePath() + "'");
}
appDirectory.mkdirs();
Manifest manifest = new Manifest();