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

Method addWelcomeFile

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

Add a welcome file to 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 add

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

Source from the content-addressed store, hash-verified

612 * @param welcomeFile The welcome file to add
613 */
614 public void addWelcomeFile(String hostName, String contextPath, String version, String welcomeFile) {
615 hostName = renameWildcardHost(hostName);
616 ContextVersion contextVersion = findContextVersion(hostName, contextPath, version, false);
617 if (contextVersion == null) {
618 return;
619 }
620 int len = contextVersion.welcomeResources.length + 1;
621 String[] newWelcomeResources = new String[len];
622 System.arraycopy(contextVersion.welcomeResources, 0, newWelcomeResources, 0, len - 1);
623 newWelcomeResources[len - 1] = welcomeFile;
624 contextVersion.welcomeResources = newWelcomeResources;
625 }
626
627
628 /**

Callers

nothing calls this directly

Calls 2

renameWildcardHostMethod · 0.95
findContextVersionMethod · 0.95

Tested by

no test coverage detected