Class HttpRootPathBuildItem

java.lang.Object
io.quarkus.builder.item.BuildItem
io.quarkus.builder.item.SimpleBuildItem
io.quarkus.vertx.http.deployment.HttpRootPathBuildItem

public final class HttpRootPathBuildItem extends io.quarkus.builder.item.SimpleBuildItem
  • Constructor Details

    • HttpRootPathBuildItem

      public HttpRootPathBuildItem(String rootPath)
  • Method Details

    • getRootPath

      public String getRootPath()
      Return normalized Http root path configured from quarkus.http.root-path. This path will always end in a slash.

      Use resolvePath(String) if you need to construct a Uri from the Http root path.

      Returns:
      Normalized Http root path ending with a slash
      See Also:
    • resolvePath

      public String resolvePath(String path)
      Resolve path into an absolute path. If path is relative, it will be resolved against `quarkus.http.root-path`. An absolute path will be normalized and returned.

      Given quarkus.http.root-path=/

      • resolvePath("foo") will return /foo
      • resolvePath("/foo") will return /foo
      Given quarkus.http.root-path=/app
      • resolvePath("foo") will return /app/foo
      • resolvePath("/foo") will return /foo

      The returned path will not end with a slash.

      Parameters:
      path - Path to be resolved to an absolute path.
      Returns:
      An absolute path not ending with a slash
      See Also:
      • UriNormalizationUtil.normalizeWithBase(URI, String, boolean)
    • relativePath

      public String relativePath(String path)
      Resolve path that is always relative into an absolute path. Whether the path is relative or absolute, it will be resolved against `quarkus.http.root-path`, by removing the '/' in the latter case.

      Given quarkus.http.root-path=/

      • relativePath("foo") will return /foo
      • relativePath("/foo") will return /foo
      Given quarkus.http.root-path=/app
      • relativePath("foo") will return /app/foo
      • relativePath("/foo") will return /app/foo

      The returned path will not end with a slash.

      Parameters:
      path - Path to be resolved to an absolute path.
      Returns:
      An absolute path not ending with a slash
      See Also:
      • UriNormalizationUtil.normalizeWithBase(URI, String, boolean)
    • routeBuilder

      public HttpRootPathBuildItem.Builder routeBuilder()