code: public static void deleteDirectory(File element)
      {
          Check.notNull(element);
  
          if (element.isDirectory())
          {
              Optional.ofNullable(element.listFiles())
                      .map(Arrays::asList)
                      .ifPresent(files -> files.forEach(UtilFolder::deleteDirectory));
              try
              {
                  Files.delete(element.toPath());
              }
              catch (final IOException exception)
              {
                  Verbose.exception(exception, ERROR_DELETE_DIRECTORY, element.getAbsolutePath());
              }
          }
          else if (element.isFile())
          {
              try
              {
                  Files.delete(element.toPath());
              }
              catch (final IOException exception)
              {
                  Verbose.exception(exception, ERROR_DELETE_FILE, element.getAbsolutePath());
              }
          }
      }
docs: Delete a directory and all of its content (be careful, it will erase all children including child directory).
  
  @param element The directory to delete with all of its content (must not be <code>null</code>).
  @throws LionEngineException If invalid parameter.