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

Method removeWelcomeFile

java/org/apache/catalina/mapper/Mapper.java:636–658  ·  view source on GitHub ↗

Remove a welcome file from the given context. @param hostName The host where the given context can be found @param contextPath The path of the given context @param version The version of the given context @param welcomeFile The welcome file to remove

(String hostName, String contextPath, String version, String welcomeFile)

Source from the content-addressed store, hash-verified

634 * @param welcomeFile The welcome file to remove
635 */
636 public void removeWelcomeFile(String hostName, String contextPath, String version, String welcomeFile) {
637 hostName = renameWildcardHost(hostName);
638 ContextVersion contextVersion = findContextVersion(hostName, contextPath, version, false);
639 if (contextVersion == null || contextVersion.isPaused()) {
640 return;
641 }
642 int match = -1;
643 for (int i = 0; i < contextVersion.welcomeResources.length; i++) {
644 if (welcomeFile.equals(contextVersion.welcomeResources[i])) {
645 match = i;
646 break;
647 }
648 }
649 if (match > -1) {
650 int len = contextVersion.welcomeResources.length - 1;
651 String[] newWelcomeResources = new String[len];
652 System.arraycopy(contextVersion.welcomeResources, 0, newWelcomeResources, 0, match);
653 if (match < len) {
654 System.arraycopy(contextVersion.welcomeResources, match + 1, newWelcomeResources, match, len - match);
655 }
656 contextVersion.welcomeResources = newWelcomeResources;
657 }
658 }
659
660
661 /**

Callers

nothing calls this directly

Calls 4

renameWildcardHostMethod · 0.95
findContextVersionMethod · 0.95
isPausedMethod · 0.95
equalsMethod · 0.65

Tested by

no test coverage detected