From 045ca0848c8ee7c771541a5829157531c782cf30 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 19 Apr 2017 14:51:48 +0300 Subject: juick-www: Home controller uses Pebble, drop ads wip --- juick-www/src/main/java/ru/sape/Sape.java | 6 ++---- juick-www/src/main/java/ru/sape/SapePageLinks.java | 23 ++++------------------ 2 files changed, 6 insertions(+), 23 deletions(-) (limited to 'juick-www/src/main/java/ru') diff --git a/juick-www/src/main/java/ru/sape/Sape.java b/juick-www/src/main/java/ru/sape/Sape.java index c00054ae..38577c45 100644 --- a/juick-www/src/main/java/ru/sape/Sape.java +++ b/juick-www/src/main/java/ru/sape/Sape.java @@ -3,8 +3,6 @@ */ package ru.sape; -import javax.servlet.http.Cookie; - public class Sape { private final String sapeUser; @@ -19,7 +17,7 @@ public class Sape { } public boolean debug = false; - public SapePageLinks getPageLinks(String requestUri, Cookie[] cookies) { - return new SapePageLinks(sapePageLinkConnection, sapeUser, requestUri, cookies, debug); + public SapePageLinks getPageLinks(String requestUri, String cookie) { + return new SapePageLinks(sapePageLinkConnection, sapeUser, requestUri, cookie, debug); } } 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; - } } -- cgit v1.2.3