Package com.vaadin.client
Class URIResolver
- java.lang.Object
-
- com.vaadin.flow.shared.VaadinUriResolver
-
- com.vaadin.client.URIResolver
-
- All Implemented Interfaces:
Serializable
public class URIResolver extends VaadinUriResolver
Client side URL resolver for vaadin protocols.- Since:
- 1.0
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description URIResolver(Registry registry)Creates a new instance connected to the given registry.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringgetBaseRelativeUri(String baseURI, String uri)Returns the given uri as relative to the given base uri.protected StringgetContextRootUrl()static StringgetCurrentLocationRelativeToBaseUri()Returns the current document location as relative to the base uri of the document.StringresolveVaadinUri(String uri)Translates a Vaadin URI to a URL that can be loaded by the browser.-
Methods inherited from class com.vaadin.flow.shared.VaadinUriResolver
resolveVaadinUri
-
-
-
-
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
http://orhttps://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 documenturi- 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.
-
-