public Object parse(StaplerRequest request, ContextInPath contextInPath, Class type, String parameterName) throws ServletException { String $provider = request.getParameter("$provider"); String $token = request.getParameter("$token"); if (StringUtils.isNotBlank($provider) && StringUtils.isNotBlank($token)) { ModelObject context = CredentialsDescriptor.lookupContext($provider, $token); if (type.isInstance(context)) { return type.cast(context); } } return CredentialsDescriptor.findContextInPath(request, type); } }
public Object parse(StaplerRequest request, ContextInPath contextInPath, Class type, String parameterName) throws ServletException { String $provider = request.getParameter("$provider"); String $token = request.getParameter("$token"); if (StringUtils.isNotBlank($provider) && StringUtils.isNotBlank($token)) { ModelObject context = CredentialsDescriptor.lookupContext($provider, $token); if (type.isInstance(context)) { return type.cast(context); } } return CredentialsDescriptor.findContextInPath(request, type); } }