import java.util.logging.Level;
import java.util.logging.Logger;
+import net.pterodactylus.sone.core.FreenetInterface.Fetched;
import net.pterodactylus.sone.main.SonePlugin;
-import net.pterodactylus.util.collection.Pair;
import net.pterodactylus.util.io.Closer;
import net.pterodactylus.util.logging.Logging;
import net.pterodactylus.util.version.Version;
-import freenet.client.FetchResult;
import freenet.keys.FreenetURI;
import freenet.support.api.Bucket;
private static final String SONE_HOMEPAGE = "USK@nwa8lHa271k2QvJ8aa0Ov7IHAV-DFOCFgmDt3X6BpCI,DuQSUZiI~agF8c-6tjsFFGuZ8eICrzWCILB60nT8KKo,AQACAAE/sone/";
/** The current latest known edition. */
- private static final int LATEST_EDITION = 54;
+ private static final int LATEST_EDITION = 55;
/** The Freenet interface. */
private final FreenetInterface freenetInterface;
public void editionFound(FreenetURI uri, long edition, boolean newKnownGood, boolean newSlot) {
logger.log(Level.FINEST, String.format("Found update for %s: %d, %s, %s", uri, edition, newKnownGood, newSlot));
if (newKnownGood || newSlot) {
- Pair<FreenetURI, FetchResult> uriResult = freenetInterface.fetchUri(uri.setMetaString(new String[] { "sone.properties" }));
+ Fetched uriResult = freenetInterface.fetchUri(uri.setMetaString(new String[] { "sone.properties" }));
if (uriResult == null) {
logger.log(Level.WARNING, String.format("Could not fetch properties of latest homepage: %s", uri));
return;
}
- Bucket resultBucket = uriResult.getRight().asBucket();
+ Bucket resultBucket = uriResult.getFetchResult().asBucket();
try {
parseProperties(resultBucket.getInputStream(), edition);
latestEdition = edition;