code: @Nonnull
    public static FileIOError deleteDir (@Nonnull final Path aDir)
    {
      ValueEnforcer.notNull (aDir, "Directory");
  
      final Path aRealDir = _getUnifiedPath (aDir);
  
      // Does the directory not exist?
      if (!aRealDir.toFile ().isDirectory ())
        return EFileIOErrorCode.SOURCE_DOES_NOT_EXIST.getAsIOError (EFileIOOperation.DELETE_DIR, aRealDir);
  
      if (isExceptionOnDeleteRoot ())
      {
        // Check that we're not deleting the complete hard drive...
        if (aRealDir.getParent () == null || aRealDir.getNameCount () == 0)
          throw new IllegalArgumentException ("Aren't we deleting the full drive: '" + aRealDir + "'");
      }
  
      // Is the parent directory writable?
      final Path aParentDir = aRealDir.getParent ();
      if (aParentDir != null && !Files.isWritable (aParentDir))
        return EFileIOErrorCode.SOURCE_PARENT_NOT_WRITABLE.getAsIOError (EFileIOOperation.DELETE_DIR, aRealDir);
  
      return _perform (EFileIOOperation.DELETE_DIR, Files::delete, aRealDir);
    }
docs: Delete an existing directory. The directory needs to be empty before it can
  be deleted.
  
  @param aDir
  The directory to be deleted. May not be <code>null</code>.
  @return A non-<code>null</code> error code.