MCPcopy Index your code
hub / github.com/apache/tomcat / isPathValid

Method isPathValid

java/org/apache/catalina/util/ContextName.java:206–215  ·  view source on GitHub ↗

Checks if the path for this instance is valid. @return true if the path given/calculated for this instance is valid, otherwise false

()

Source from the content-addressed store, hash-verified

204 * @return {@code true} if the path given/calculated for this instance is valid, otherwise {@code false}
205 */
206 public boolean isPathValid() {
207 // No need to test for null since path can never be null (see constructors)
208 //
209 // Therefore, just need to check:
210 // - empty or start with /
211 // - normalized and no attempt to escape the root
212 //
213 // Note: Normalize check on empty path would fail
214 return path.isEmpty() || (path.startsWith("/") && path.equals(RequestUtil.normalize(path)));
215 }
216
217
218 /**

Callers 4

deployDescriptorMethod · 0.80
deployWARMethod · 0.80
deployDirectoryMethod · 0.80
validateContextNameMethod · 0.80

Calls 4

normalizeMethod · 0.95
equalsMethod · 0.65
isEmptyMethod · 0.45
startsWithMethod · 0.45

Tested by

no test coverage detected