package com.vikram.configuration;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.util.WebUtils;

import com.vikram.openconnect.login.IAccessToken;

public class AccessToken implements IAccessToken {

	private static String COOKIE_NAME = "access_token";

	@Override
	public void setAccessToken(String accessToken, HttpServletResponse response) {
		response.addCookie(new Cookie(COOKIE_NAME,accessToken));	
	}

	@Override
	public String getAccessToken(HttpServletRequest request) {
		Cookie accessToken = WebUtils.getCookie(request, COOKIE_NAME);
		return accessToken==null?"":accessToken.getValue();
	}

	
	

}

@@ -657,15 +657,11 @@
 ;%0A%09%09
-return 
+if(
 acce
@@ -671,18 +671,27 @@
 oken
-=
+!
 =null
-?%22%22:
+)%7B%0A%09%09%09return 
 acce
@@ -710,16 +710,33 @@
 alue();%0A
+%09%09%7D%0A%09%09return %22%22;%0A
 %09%7D%0A%0A%09%0A%09%0A

Fix NPE