question: public static boolean deleteDirectorySubdirectories ( String rootDirectory ) { if ( ( rootDirectory == null ) ) { return false ; } boolean didSuccessfullyDeleteAllDirectories = true ; try { List < File > files = getListOfFilesInADirectory ( rootDirectory ) ; for ( File file : files ) { if ( file . isDirectory ( ) ) { boolean deleteSuccess = deleteDirectoryAndContents ( file ) ; if ( ! deleteSuccess ) { logger . debug ( "Warning - failed to delete " + file . getAbsolutePath ( ) ) ; didSuccessfullyDeleteAllDirectories = false ; } } } } catch ( Exception e ) { logger . debug ( e . toString ( ) + System . lineSeparator ( ) + StackTrace . getStringFromStackTrace ( e ) ) ; return false ; } return didSuccessfullyDeleteAllDirectories ; }
target:  This is a quiet method. Only deletes directories. Will fail if the directories have files in them.