Class URIResolver

    • Constructor Detail

      • URIResolver

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

      • 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.