Class StaticContentLoader.Validator

java.lang.Object
org.apache.struts2.dispatcher.StaticContentLoader.Validator
Enclosing interface:
StaticContentLoader

public static class StaticContentLoader.Validator extends Object
  • Constructor Details

    • Validator

      public Validator()
  • Method Details

    • validateStaticContentPath

      public static String validateStaticContentPath(String uiStaticContentPath)
    • canonicalisePath

      public static Optional<String> canonicalisePath(String path)
      Normalises a resource path by resolving . and .. segments and converting backslash separators to forward slashes.

      Returns Optional.empty() if the resolved path would escape above the root (i.e. more .. segments than preceding path components).

      Parameters:
      path - the raw path to normalise (must not be null)
      Returns:
      the canonical path without leading slash, or empty if the path escapes above the root