code: public void createDir(String key, int ttl, Boolean prevExist) throws EtcdClientException {
          Preconditions.checkNotNull(key);
  
          List<BasicNameValuePair> data = Lists.newArrayList();
          data.add(new BasicNameValuePair("dir", String.valueOf(true)));
          if (ttl > 0) {
              data.add(new BasicNameValuePair("ttl", String.valueOf(ttl)));
          }
          if (prevExist != null) {
              data.add(new BasicNameValuePair("prevExist", String.valueOf(prevExist)));
          }
  
          put(key, data, null, new int[]{200, 201});
      }
docs: Create directories with optional ttl and prevExist(update dir ttl)
  @param key the key
  @param ttl the ttl
  @param prevExist exists before
  @throws EtcdClientException