Package org.apache.struts2.dispatcher
Class StaticContentLoader.Validator
java.lang.Object
org.apache.struts2.dispatcher.StaticContentLoader.Validator
- Enclosing interface:
- StaticContentLoader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncanonicalisePath(String path) Normalises a resource path by resolving.and..segments and converting backslash separators to forward slashes.static StringvalidateStaticContentPath(String uiStaticContentPath)
-
Constructor Details
-
Validator
public Validator()
-
-
Method Details
-
validateStaticContentPath
-
canonicalisePath
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
-