public static java.lang.String | normalize(java.lang.String path)Return a context-relative path, beginning with a "/", that represents
the canonical version of the specified path after ".." and "." elements
are resolved out. If the specified path attempts to go outside the
boundaries of the current context (i.e. too many ".." path elements are
present), return null instead. This normalize should be
the same as DefaultServlet.normalize, which is almost the same ( see
source code below ) as RequestUtil.normalize. Do we need all this
duplication?
if (path == null) return null;
String normalized = path;
//Why doesn't RequestUtil do this??
// Normalize the slashes and add leading slash if necessary
if (normalized.indexOf('\\") >= 0)
normalized = normalized.replace('\\", '/");
normalized = RequestUtil.normalize(path);
return normalized;
|