Class FrontendDependencyUrlResolver

java.lang.Object
com.vaadin.flow.server.FrontendDependencyUrlResolver
All Implemented Interfaces:
Serializable

public final class FrontendDependencyUrlResolver extends Object implements Serializable
Resolves the value() of StyleSheet annotation values to a canonical form that BootstrapHandler.BootstrapUriResolver can expand at render time. The same rules are used whether the annotation is on an AppShellConfigurator or on an ordinary Component.

For internal framework use only.

See Also:
  • Method Details

    • resolveToContextRoot

      public static String resolveToContextRoot(String rawValue)
      Normalizes a frontend-dependency URL value to a form that the bootstrap URI resolver can expand.

      Rules, in order:

      1. null or blank values return null.
      2. Values containing path traversals (..) are rejected with a warning and null is returned.
      3. http://, https://, //, context:// and base:// prefixes are returned unchanged.
      4. A leading ./ is stripped.
      5. If the value (after the previous step) starts with /, it is returned unchanged.
      6. Otherwise, context:// is prepended so the value resolves against the servlet context root.
      Parameters:
      rawValue - the raw annotation value
      Returns:
      the normalized value, or null if rejected