Java Code Examples for org.apache.commons.lang3.StringUtils#removeStartIgnoreCase()

The following examples show how to use org.apache.commons.lang3.StringUtils#removeStartIgnoreCase() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
 * 比较referer 和URI是否相同
 * @param request
 * @param uri 
public static boolean compare(HttpServletRequest request,String uri){
	String referer = request.getHeader("referer");
	String newReferer = StringUtils.removeStartIgnoreCase(referer,Configuration.getUrl(request));//移除开始部分的相同的字符,不区分大小写
	newReferer = StringUtils.substringBefore(newReferer, ".");//截取到等于第二个参数的字符串为止
	newReferer = StringUtils.substringBefore(newReferer, "?");//截取到等于第二个参数的字符串为止
		return true;
	return false;
Example 2
Source Project: java-platform   File:    License: Apache License 2.0 5 votes vote down vote up
public OauthUser getOauthUser(String accessToken) {
	Map<String, Object> parameterMap = new HashMap<>();
	parameterMap.put("access_token", accessToken);
	String responseString = get("", parameterMap);
	responseString = StringUtils.trim(responseString);
	responseString = StringUtils.removeStartIgnoreCase(responseString, "callback(");
	responseString = StringUtils.removeEndIgnoreCase(responseString, ");");
	JSONObject jsonObject = JSON.parseObject(responseString);

	String openid = jsonObject.getString("openid");
	OauthUser oauthUser = oauthUserService.findByOauthPluginIdAndUserId(getId(), openid);
	if (oauthUser == null) {
		Map<String, Object> apiMap = new HashMap<>();
		apiMap.put("access_token", accessToken);
		apiMap.put("oauth_consumer_key", jsonObject.getString("client_id"));
		apiMap.put("openid", openid);
		String apiString = get("", apiMap);
		JSONObject userObject = JSON.parseObject(apiString);

		oauthUser = oauthUserService.newEntity();

	return oauthUser;
Example 3
public void setValue(final Object value) throws ConfigurationRuntimeException
        if (!(value instanceof String))
            this.value = value;
        final String val = (String) value;
        final String name = StringUtils.removeStartIgnoreCase(val, CLASS);
        final Class<?> clazz = ClassUtils.getClass(name);
        if (name.length() == val.length())
            this.value = clazz.newInstance();
            this.value = clazz;
    catch (final Exception e)
        throw new ConfigurationRuntimeException("Unable to create " + value, e);

Example 4
Source Project: vscrawler   File:    License: Apache License 2.0 4 votes vote down vote up
protected String handle(String input, String second) {
    return StringUtils.removeStartIgnoreCase(input, second);