aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/java/ru
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-04-19 14:51:48 +0300
committerGravatar Vitaly Takmazov2017-05-05 12:06:28 +0300
commit045ca0848c8ee7c771541a5829157531c782cf30 (patch)
tree9a60049dae790fd01ace40d3757c0bfda74cd220 /juick-www/src/main/java/ru
parent9345af5e39695d191b221473ce3a51b03dc09db3 (diff)
juick-www: Home controller uses Pebble, drop ads
wip
Diffstat (limited to 'juick-www/src/main/java/ru')
-rw-r--r--juick-www/src/main/java/ru/sape/Sape.java6
-rw-r--r--juick-www/src/main/java/ru/sape/SapePageLinks.java23
2 files changed, 6 insertions, 23 deletions
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;
- }
}