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

Method removeContextVersion

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

Remove a context from an existing host. @param ctxt The actual context @param hostName Virtual host name this context belongs to @param path Context path @param version Context version

(Context ctxt, String hostName, String path, String version)

Source from the content-addressed store, hash-verified

333 * @param version Context version
334 */
335 public void removeContextVersion(Context ctxt, String hostName, String path, String version) {
336
337 hostName = renameWildcardHost(hostName);
338 contextObjectToContextVersionMap.remove(ctxt);
339
340 MappedHost host = exactFind(hosts, hostName);
341 if (host == null || host.isAlias()) {
342 return;
343 }
344
345 synchronized (host) {
346 ContextList contextList = host.contextList;
347 MappedContext context = exactFind(contextList.contexts, path);
348 if (context == null) {
349 return;
350 }
351
352 ContextVersion[] contextVersions = context.versions;
353 ContextVersion[] newContextVersions = new ContextVersion[contextVersions.length - 1];
354 if (removeMap(contextVersions, newContextVersions, version)) {
355 if (newContextVersions.length == 0) {
356 // Remove the context
357 ContextList newContextList = contextList.removeContext(path);
358 if (newContextList != null) {
359 updateContextList(host, newContextList);
360 }
361 } else {
362 context.versions = newContextVersions;
363 }
364 }
365 }
366 }
367
368
369 /**

Callers 3

runMethod · 0.80
unregisterContextMethod · 0.80

Calls 7

renameWildcardHostMethod · 0.95
exactFindMethod · 0.95
isAliasMethod · 0.95
removeMapMethod · 0.95
removeContextMethod · 0.95
updateContextListMethod · 0.95
removeMethod · 0.65

Tested by 2

runMethod · 0.64