Skip to content

Commit 616d5a5

Browse files
committed
Fix recursive deletion
1 parent 81e6ac0 commit 616d5a5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/java/org/polypheny/control/control/ServiceManager.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -652,15 +652,17 @@ private static void buildPdb( final ClientCommunicationStream clientCommunicatio
652652
if ( configuration.getString( "pcrtl.plugins.purge" ).equals( "afterBuilding" ) ) {
653653
File pluginsFolder = new File( configuration.getString( "pcrtl.pdbms.pluginsdir" ) );
654654
if ( pluginsFolder.exists() ) {
655-
if ( !pluginsFolder.delete() ) {
655+
try {
656+
FileUtils.deleteDirectory( pluginsFolder );
657+
if ( clientCommunicationStream != null ) {
658+
clientCommunicationStream.send( "> Purged Polypheny plugins folder!" );
659+
}
660+
} catch ( IOException e ) {
656661
if ( clientCommunicationStream != null ) {
657662
clientCommunicationStream.send( "> Unable to purge folder!" );
658663
}
659664
throw new RuntimeException( "Unable to purge folder!" );
660665
}
661-
if ( clientCommunicationStream != null ) {
662-
clientCommunicationStream.send( "> Purged Polypheny plugins folder!" );
663-
}
664666
}
665667
}
666668
}

0 commit comments

Comments
 (0)