diff --git a/src/main/java/org/polypheny/control/control/ServiceManager.java b/src/main/java/org/polypheny/control/control/ServiceManager.java index d640d47..788232a 100644 --- a/src/main/java/org/polypheny/control/control/ServiceManager.java +++ b/src/main/java/org/polypheny/control/control/ServiceManager.java @@ -862,6 +862,14 @@ public static boolean purgePolyphenyFolder( ClientCommunicationStream clientComm throw new RuntimeException( "Unable to purge Polypheny home folder!" ); } } + + // Check if everything has been deleted + for ( File f : polyphenyDir.listFiles() ) { + if ( f.getName().equals( "uuid" ) || f.getName().equals( "certs" ) ) { + continue; + } + throw new RuntimeException( "Unable to delete certain files in the Polypheny home folder!" ); + } } // Check if there are any test backups of the home folder (e.g., created for integration tests). There should not be any, but if there is, delete it as this folder would be restored on startup @@ -874,6 +882,10 @@ public static boolean purgePolyphenyFolder( ClientCommunicationStream clientComm } throw new RuntimeException( "Unable to purge backup of Polypheny home holder!" + polyphenyTestBackupDir.getAbsolutePath() ); } + // Check if folder has been deleted + if ( polyphenyTestBackupDir.exists() ) { + throw new RuntimeException( "Unable to purge backup of Polypheny home holder!" + polyphenyTestBackupDir.getAbsolutePath() ); + } } log.info( "> Polypheny home folder has been purged!" );