Class URIResolver

java.lang.Object
com.vaadin.flow.shared.VaadinUriResolver
com.vaadin.client.URIResolver
All Implemented Interfaces:
Serializable

public class URIResolver extends com.vaadin.flow.shared.VaadinUriResolver
Client side URL resolver for vaadin protocols.
Since:
1.0
Author:
Vaadin Ltd
See Also:
  • Constructor Details

    • URIResolver

      public URIResolver(Registry registry)
      Creates a new instance connected to the given registry.
      Parameters:
      registry - the global registry
  • Method Details

    • resolveVaadinUri

      public String resolveVaadinUri(String uri)
      Translates a Vaadin URI to a URL that can be loaded by the browser. The following URI schemes are supported:
      • "context://" - resolves to the application context root
      • "base://" - resolves to the base URI of the page
      Any other URI protocols, such as http:// or https:// are passed through this method unmodified.
      Parameters:
      uri - the URI to resolve
      Returns:
      the resolved URI
    • getContextRootUrl

      protected String getContextRootUrl()
    • getCurrentLocationRelativeToBaseUri

      public static String getCurrentLocationRelativeToBaseUri()
      Returns the current document location as relative to the base uri of the document.
      Returns:
      the document current location as relative to the document base uri
    • getBaseRelativeUri

      public static String getBaseRelativeUri(String baseURI, String uri)
      Returns the given uri as relative to the given base uri.
      Parameters:
      baseURI - the base uri of the document
      uri - an absolute uri to transform
      Returns:
      the uri as relative to the document base uri, or the given uri unmodified if it is for different context.