/* (non-Javadoc)
@see com.ibm.ws.webcontainer.webapp.IWebAppDispatcherContext#getContextPath()
966045
public String getContextPath()
    {
        if (parentContext!=null && _useParent)
            return parentContext.getContextPath();
        String cp =null;
        if (_contextPath!=null)
            cp=_contextPath;
        else
            cp = getWebApp().getContextPath();
        if (cp.equals("/"))
        {
            return "";
        }
        else
        {
            return cp;
        }
    }
1227929
public String getEndpoint() {
    try {
      String endpointString = uri.getPath().split("/")[3];
      if (!endpointString.equals(ENDPOINT_IN) && !endpointString.equals(ENDPOINT_OUT)) {
        throw new IllegalArgumentException(endpointString + " is not a valid context endpoint");
      }
      return endpointString;
    } catch (IndexOutOfBoundsException e) {
      return null;
    }
  }
1370030
public String getContextPath()
	{
		//PM47487
		String cp = context.getContextPath();
		if (WCCustomProperties.RETURN_DEFAULT_CONTEXT_PATH && cp.equals("/")){
			cp = "";
		}
		//PM47487
		return cp;
	}
1069842
protected String getRequestPath(String requestFullPath, String servletContextPath, String servletPath) {
		return requestFullPath.substring(escapedLength(servletContextPath) + escapedLength(servletPath));
	}
1294812
public NavigationResult navigate(Context context) {
    PackageManager pm = context.getPackageManager();
    Bundle finalAppLinkData = buildAppLinkDataForNavigation(context);

    Intent eligibleTargetIntent = null;
    for (AppLink.Target target : getAppLink().getTargets()) {
      Intent targetIntent = new Intent(Intent.ACTION_VIEW);
      if (target.getUrl() != null) {
        targetIntent.setData(target.getUrl());
      } else {
        targetIntent.setData(appLink.getSourceUrl());
      }
      targetIntent.setPackage(target.getPackageName());
      if (target.getClassName() != null) {
        targetIntent.setClassName(target.getPackageName(), target.getClassName());
      }
      targetIntent.putExtra(AppLinks.KEY_NAME_APPLINK_DATA, finalAppLinkData);

      ResolveInfo resolved = pm.resolveActivity(targetIntent, PackageManager.MATCH_DEFAULT_ONLY);
      if (resolved != null) {
        eligibleTargetIntent = targetIntent;
        break;
      }
    }

    Intent outIntent = null;
    NavigationResult result = NavigationResult.FAILED;
    if (eligibleTargetIntent != null) {
      outIntent = eligibleTargetIntent;
      result = NavigationResult.APP;
    } else {
      // Fall back to the web if it's available
      Uri webUrl = getAppLink().getWebUrl();
      if (webUrl != null) {
        JSONObject appLinkDataJson;
        try {
          appLinkDataJson = getJSONForBundle(finalAppLinkData);
        } catch (JSONException e) {
          sendAppLinkNavigateEventBroadcast(context, eligibleTargetIntent, NavigationResult.FAILED, e);
          throw new RuntimeException(e);
        }
        webUrl = webUrl.buildUpon()
            .appendQueryParameter(AppLinks.KEY_NAME_APPLINK_DATA, appLinkDataJson.toString())
            .build();
        outIntent = new Intent(Intent.ACTION_VIEW, webUrl);
        result = NavigationResult.WEB;
      }
    }

    sendAppLinkNavigateEventBroadcast(context, outIntent, result, null);
    if (outIntent != null) {
      context.startActivity(outIntent);
    }
    return result;
  }
600378
public ServerConfig setContextPath(String contextPath) {
        if (!contextPath.endsWith(StringUtils.CONTEXT_SEP)) {
            contextPath += StringUtils.CONTEXT_SEP;
        }
        this.contextPath = contextPath;
        return this;
    }
14284
function getPathFromContext (ctx) {
  let path = ctx.path.join('.')

  // check if we specifically set type
  const lastElement = ctx.path[ctx.path.length - 1]
  if (lastElement) {
    const lev = lastElement.toLowerCase()
    if (lev === 'type') {
      path = ctx.path.slice(0, ctx.path.length - 1).join('.')
    }
  }

  // check if in array
  const reg = new RegExp('^\\d+$')
  const lastPath = path.substring(path.lastIndexOf('.') + 1)
  if (lastPath && reg.test(lastPath)) {
    path = path.substring(0, path.lastIndexOf('.'))
  }

  return path
}
291547
public String getContextUrl(HttpServletRequest request) {
        StringBuffer url = request.getRequestURL();
        String context = request.getContextPath();
        String contextUrl = url.substring(0, url.indexOf(context)
                + context.length());
        return contextUrl;
    }
1133919
function getContext() {
	if (application.android.context) {
		return (application.android.context);
	}
	if (typeof application.getNativeApplication === 'function') {
		let ctx = application.getNativeApplication();
		if (ctx) {
			return ctx;
		}
	}


	//noinspection JSUnresolvedFunction,JSUnresolvedVariable
	let ctx = java.lang.Class.forName("android.app.AppGlobals").getMethod("getInitialApplication", null).invoke(null, null);
	if (ctx) return ctx;

	//noinspection JSUnresolvedFunction,JSUnresolvedVariable
	ctx = java.lang.Class.forName("android.app.ActivityThread").getMethod("currentApplication", null).invoke(null, null);
	if (ctx) return ctx;

	return ctx;
}
315293
public com.google.api.Context getContext() {
    return context_ == null ? com.google.api.Context.getDefaultInstance() : context_;
  }
1136828
private static String getContextPathOverride(boolean isSslRequest, JawrConfig config) {
		String contextPathOverride = null;
		if (isSslRequest) {
			contextPathOverride = config.getContextPathSslOverride();
		} else {
			contextPathOverride = config.getContextPathOverride();
		}
		return contextPathOverride;
	}
1266566
@Override
	public String getResourcePath(String basePath, String relativePath) {

		String result = null;
		if (binaryGeneratorRegistry.isGeneratedBinaryResource(relativePath)) {
			result = relativePath;
		} else if (contextPath != null && relativePath.startsWith(contextPath)) {
			result = relativePath.substring(contextPath.length() - 1);
		} else {
			result = PathNormalizer.concatWebPath(basePath, relativePath);
		}
		return result;
	}
14999
private String findSpringContextFileName(Object handler, Annotation[] annotations) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
        String contextFileName = null;
        for (Annotation a : annotations) {
            String n = a.annotationType().getSimpleName();
            if ( n.equals("ContextConfiguration") || n.equals("SpringContext")) {
                log.trace("Found an spring context annotation " + a);
                contextFileName = getContextPathFromSpringAnnotation(handler, a, n);
                if ( contextFileName != null) {
                    break;
                }
            }
        }
        return contextFileName;
    }
354519
@NonNull public Context getContext() {
        if (searchView != null) {
            return searchView.getContext();
        } else if (supportView != null) {
            return supportView.getContext();
        }
        throw new IllegalStateException(ERROR_NO_SEARCHVIEW);
    }
626277
public static Context getApplicationContext() {
        com.ardikars.jxnet.context.Context context = com.ardikars.jxnet.context.Application.getApplicationContext();
        return new ApplicationContext(context);
    }
1042501
public void redirectToContextPath(String path) {
        if ("".equals(contextPath)) {
            // context path is the root
            redirect(path);
        } else {
            redirect(contextPath + StringUtils.addStart(path, "/"));
        }
    }
996738
public void setContextPath(String contextPath) {

		if (contextPath != null && !contextPath.endsWith("/")) {
			contextPath += "/";
		}
		this.contextPath = contextPath;
	}