Example #1
0
  /**
   * Updates existing corpus meta-data (access and permissions).
   *
   * @param accountId String the Account identifier.
   * @param corpus {@link Corpus} the corpus to update.
   */
  public void updateCorpus(final String accountId, final Corpus corpus) {
    Validate.notNull(accountId, "account_id can't be null");
    Validate.notNull(corpus, "corpus can't be null");
    Validate.notNull(corpus.getId(), "corpus.id can't be null");

    HttpRequestBase request =
        Request.Post(createCorpusIdPath(accountId, corpus.getId()))
            .withContent(GsonSingleton.getGson().toJson(corpus), MediaType.APPLICATION_JSON)
            .build();
    executeWithoutResponse(request);
  }