MCPcopy Create free account
hub / github.com/apache/tomcat / getPaths

Method getPaths

java/org/apache/catalina/startup/Bootstrap.java:578–615  ·  view source on GitHub ↗
(String value)

Source from the content-addressed store, hash-verified

576
577 // Protected for unit testing
578 static String[] getPaths(String value) {
579
580 List<String> result = new ArrayList<>();
581 Matcher matcher = PATH_PATTERN.matcher(value);
582
583 while (matcher.find()) {
584 String path = value.substring(matcher.start(), matcher.end());
585
586 path = path.trim();
587 if (path.isEmpty()) {
588 continue;
589 }
590
591 char first = path.charAt(0);
592 char last = path.charAt(path.length() - 1);
593
594 if (first == '"' && last == '"' && path.length() > 1) {
595 path = path.substring(1, path.length() - 1);
596 path = path.trim();
597 if (path.isEmpty()) {
598 continue;
599 }
600 } else if (path.contains("\"")) {
601 // Unbalanced quotes
602 // Too early to use standard i18n support. The class path hasn't
603 // been configured.
604 throw new IllegalArgumentException(
605 "The double quote [\"] character can only be used to quote paths. It must " +
606 "not appear in a path. This loader path is not valid: [" + value + "]");
607 } else {
608 // Not quoted - NO-OP
609 }
610
611 result.add(path);
612 }
613
614 return result.toArray(new String[0]);
615 }
616}

Callers 2

doTestMethod · 0.95
createClassLoaderMethod · 0.95

Calls 10

charAtMethod · 0.80
lengthMethod · 0.80
startMethod · 0.65
endMethod · 0.65
containsMethod · 0.65
addMethod · 0.65
findMethod · 0.45
trimMethod · 0.45
isEmptyMethod · 0.45
toArrayMethod · 0.45

Tested by 1

doTestMethod · 0.76