code: public void deleteDir(String key, boolean recursive) throws EtcdClientException {
          Preconditions.checkNotNull(key);
  
          Map<String, String> params = new HashMap<String, String>();
          if (recursive) {
              params.put("recursive", String.valueOf(true));
          } else {
              params.put("dir", String.valueOf(true));
          }
  
          URI uri = buildUriWithKeyAndParams(key, params);
  
          HttpDelete httpDelete = new HttpDelete(uri);
          syncExecute(httpDelete, new int[]{200, 403});
      }
docs: Deleting a directory
  @param key the dir key
  @param recursive set recursive=true if the directory holds keys
  // @return operation result
  @throws EtcdClientException