From b0bdce22447ff815512ae7612dd4ab4a5d9a409a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 3 Jun 2020 17:32:55 +0300 Subject: sape: switch to xml output --- src/main/java/ru/sape/Sape.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/java/ru/sape/Sape.java') diff --git a/src/main/java/ru/sape/Sape.java b/src/main/java/ru/sape/Sape.java index a94bcc62..6b28be25 100644 --- a/src/main/java/ru/sape/Sape.java +++ b/src/main/java/ru/sape/Sape.java @@ -4,6 +4,7 @@ package ru.sape; import java.net.URI; +import java.util.Optional; public class Sape { @@ -19,7 +20,8 @@ public class Sape { } public boolean debug = false; - public SapePageLinks getPageLinks(URI requestUri, String cookie) { - return new SapePageLinks(sapePageLinkConnection, sapeUser, requestUri, cookie, debug); + public Optional getPageLinks(URI requestUri, String cookie) { + return sapePageLinkConnection.getData() + .map(site -> new SapePageLinks(site, sapeUser, requestUri, cookie, debug)); } } -- cgit v1.2.3