Class BaseURIBuilder

java.lang.Object
eu.acclimatize.unison.BaseURIBuilder

public class BaseURIBuilder extends Object
Builds URIs for use with HATEOAS/HAL and the location header when new resources are created. A forwarded filter bean created in UnisonServerApplication ensures that the schema, server name, and port reflect the correct values if requests are forwarded via a proxy.
  • Constructor Details

    • BaseURIBuilder

      public BaseURIBuilder()
  • Method Details

    • build

      public String build(String scheme, String serverName, int port, String contextPath)
      Creates a base URI.
      Parameters:
      scheme - The scheme of local server or forwarding proxy.
      serverName - The name of local server or forwarding proxy.
      port - The port of local server or forwarding proxy.
      contextPath - The context path, which precedes the servlet path. The context path may be an empty string.
      Returns:
      The built URI.