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

Method removeHost

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

Remove a host from the mapper. @param name Virtual host name

(String name)

Source from the content-addressed store, hash-verified

160 * @param name Virtual host name
161 */
162 public synchronized void removeHost(String name) {
163 name = renameWildcardHost(name);
164 // Find and remove the old host
165 MappedHost host = exactFind(hosts, name);
166 if (host == null || host.isAlias()) {
167 return;
168 }
169 MappedHost[] newHosts = hosts.clone();
170 // Remove real host and all its aliases
171 int j = 0;
172 for (int i = 0; i < newHosts.length; i++) {
173 if (newHosts[i].getRealHost() != host) {
174 newHosts[j++] = newHosts[i];
175 }
176 }
177 hosts = Arrays.copyOf(newHosts, j);
178 }
179
180 /**
181 * Add an alias to an existing host.

Callers 2

testRemoveHostMethod · 0.45
unregisterHostMethod · 0.45

Calls 5

renameWildcardHostMethod · 0.95
exactFindMethod · 0.95
isAliasMethod · 0.95
getRealHostMethod · 0.80
cloneMethod · 0.65

Tested by 1

testRemoveHostMethod · 0.36