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;
}

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 ; }
this is a quiet method . only deletes directories . will fail if the directories have files in them .
