Class FileRequest<T>

java.lang.Object
com.linecorp.centraldogma.client.FileRequest<T>

public final class FileRequest<T> extends Object
Prepares to send a CentralDogma.getFile(String, String, Revision, Query) request to the Central Dogma repository.
  • Method Details

    • get

      public CompletableFuture<Entry<T>> get()
      Retrieves a file located at Query.path() at the Revision.HEAD.
      Returns:
      the Entry that is matched by the given Query
    • get

      public CompletableFuture<Entry<T>> get(Revision revision)
      Retrieves a file located at Query.path() at the Revision.
      Returns:
      the Entry that is matched by the given Query
    • viewRaw

      public FileRequest<T> viewRaw(boolean viewRaw)
      Sets whether to view the raw content of the file. Default is false which means the content may be normalized.

      Note that QueryType.JSON_PATH query cannot be used with raw view.

    • renderTemplate

      public FileRequest<T> renderTemplate(boolean renderTemplate)
      Sets whether to apply template processing to the file using the variables defined in the same repository and its parent project.

      If viewRaw(boolean) is set to true, the template processing will be applied to the raw content. If viewRaw(boolean) is set to false, the template processing will be applied to the normalized content.

    • renderTemplate

      public FileRequest<T> renderTemplate(String variableFile)
      Applies template processing to the file using the specified variable file in the same repository. The variable file must be a JSON, JSON5 or YAML file and have an object at the top level (arrays or string are not allowed).

      If viewRaw(boolean) is set to true, the template processing will be applied to the raw content. If viewRaw(boolean) is set to false, the template processing will be applied to the normalized content.