aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/ru/sape
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2020-10-08 16:45:34 +0300
committerGravatar Vitaly Takmazov2020-10-08 16:45:34 +0300
commit7229f06e0bc5c61dc17cb539c7b54273b66b16b6 (patch)
tree5b282a284e3db575a0f9359b3e7313454ffb06d5 /src/main/java/ru/sape
parent94380f2301be01b395a2736e5c4539f073c9788d (diff)
Sape: refactoring
Diffstat (limited to 'src/main/java/ru/sape')
-rw-r--r--src/main/java/ru/sape/Sape.java3
-rw-r--r--src/main/java/ru/sape/SapePageLinks.java4
2 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/ru/sape/Sape.java b/src/main/java/ru/sape/Sape.java
index bf975550..83a18331 100644
--- a/src/main/java/ru/sape/Sape.java
+++ b/src/main/java/ru/sape/Sape.java
@@ -35,10 +35,9 @@ public class Sape {
"/code.php?user=" + sapeUser + "&host=" + host,
"SAPE_Client PHP", socketTimeout, cacheLifeTime);
}
- public boolean debug = false;
public Optional<SapePageLinks> getPageLinks(URI requestUri, String cookie) {
return sapePageLinkConnection.getData()
- .map(site -> new SapePageLinks(site, sapeUser, requestUri, cookie, debug));
+ .map(site -> new SapePageLinks(site, sapeUser, requestUri, cookie));
}
}
diff --git a/src/main/java/ru/sape/SapePageLinks.java b/src/main/java/ru/sape/SapePageLinks.java
index 6cbfa42f..285d38f6 100644
--- a/src/main/java/ru/sape/SapePageLinks.java
+++ b/src/main/java/ru/sape/SapePageLinks.java
@@ -31,13 +31,13 @@ public class SapePageLinks {
private final String linkDelimiter;
private final List<String> pageLinks;
- public SapePageLinks(Site site, String sapeUser, URI request, String sapeCookie, boolean showPageCode) {
+ public SapePageLinks(Site site, String sapeUser, URI request, String sapeCookie) {
String req = StringUtils.isNotEmpty(request.getQuery()) ? request.getPath() + "?" + request.getQuery()
: request.getPath();
linkDelimiter = site.getDelimiter();
- this.showCode = showPageCode || sapeUser.equals(sapeCookie);
+ this.showCode = sapeUser.equals(sapeCookie);
if (showCode) {
pageLinks = Collections.singletonList(site.getCode());