}
/**
- * Sets the edition to rescue.
- *
- * @param edition
- * The edition to rescue
- * @return This Sone rescuer
- */
- public void setEdition(long edition) {
- currentEdition = edition;
- }
-
- /**
* Sets whether the last fetch was successful.
*
* @return {@code true} if the last fetch was successful, {@code false}
//
/**
- * Starts the next fetch. If you want to fetch a different edition than βthe
- * next older one,β remember to call {@link #setEdition(long)} before
- * calling this method.
+ * Starts the next fetch.
*/
public void startNextFetch() {
fetching = true;
}
if (fetching) {
core.lockSone(sone);
- FreenetURI soneUri = sone.getRequestUri().setKeyType("SSK").setDocName("Sone-" + currentEdition).setMetaString(new String[] { "sone.xml" });
+ FreenetURI soneUri = sone.getRequestUri().setKeyType("SSK").setDocName("Sone-" + getNextEdition()).setMetaString(new String[] { "sone.xml" });
System.out.println("URI: " + soneUri);
Sone fetchedSone = soneDownloader.fetchSone(sone, soneUri, true);
System.out.println("Sone: " + fetchedSone);
lastFetchSuccessful = (fetchedSone != null);
if (lastFetchSuccessful) {
core.updateSone(fetchedSone, true);
+ currentEdition = getNextEdition();
}
fetching = false;
}