diff options
Diffstat (limited to 'juick-www/src/main/java/ru/sape/SapePageLinks.java')
-rw-r--r-- | juick-www/src/main/java/ru/sape/SapePageLinks.java | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/juick-www/src/main/java/ru/sape/SapePageLinks.java b/juick-www/src/main/java/ru/sape/SapePageLinks.java index 458358b8..e89b4e71 100644 --- a/juick-www/src/main/java/ru/sape/SapePageLinks.java +++ b/juick-www/src/main/java/ru/sape/SapePageLinks.java @@ -1,19 +1,18 @@ package ru.sape; import java.util.*; -import javax.servlet.http.Cookie; public class SapePageLinks { private boolean showCode; - public SapePageLinks(SapeConnection sapeConnection, String sapeUser, String requestUri, Cookie[] cookies) { - this(sapeConnection, sapeUser, requestUri, cookies, false); + public SapePageLinks(SapeConnection sapeConnection, String sapeUser, String requestUri, String sapeCookie) { + this(sapeConnection, sapeUser, requestUri, sapeCookie, false); } @SuppressWarnings("unchecked") - public SapePageLinks(SapeConnection sapeConnection, String sapeUser, String requestUri, Cookie[] cookies, boolean showCode) { - if (sapeUser.equals(getCookieValue(cookies, "sape_cookie"))) { + public SapePageLinks(SapeConnection sapeConnection, String sapeUser, String requestUri, String sapeCookie, boolean showCode) { + if (sapeUser.equals(sapeCookie)) { showCode = true; } @@ -74,18 +73,4 @@ public class SapePageLinks { return s.toString(); } - - private static String getCookieValue(Cookie[] cookies, String name) { - if (cookies == null) { - return null; - } - - for (Cookie cookie : cookies) { - if (cookie.getName().equals(name)) { - return cookie.getValue(); - } - } - - return null; - } } |