X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=inline;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FSoneInserter.java;h=15e054f957413db5725a818b893f1977b5a746df;hb=40a17ccc4208fd614211c8a3a69ebdf330161971;hp=2133b56d7ae65226a605ece86a8978c446f25873;hpb=94a58c591d942918b1f7f25c04be04102cd5156d;p=Sone.git
diff --git a/src/main/java/net/pterodactylus/sone/core/SoneInserter.java b/src/main/java/net/pterodactylus/sone/core/SoneInserter.java
index 2133b56..15e054f 100644
--- a/src/main/java/net/pterodactylus/sone/core/SoneInserter.java
+++ b/src/main/java/net/pterodactylus/sone/core/SoneInserter.java
@@ -160,7 +160,7 @@ public class SoneInserter extends AbstractService {
protected void serviceRun() {
long lastModificationTime = 0;
String lastFingerprint = "";
- while (!shouldStop()) {
+ while (!shouldStop()) { try {
/* check every seconds. */
sleep(1000);
@@ -204,7 +204,7 @@ public class SoneInserter extends AbstractService {
core.setSoneStatus(sone, SoneStatus.inserting);
long insertTime = System.currentTimeMillis();
insertInformation.setTime(insertTime);
- FreenetURI finalUri = freenetInterface.insertDirectory(insertInformation.getInsertUri().setKeyType("USK").setSuggestedEdition(0), insertInformation.generateManifestEntries(), "index.html");
+ FreenetURI finalUri = freenetInterface.insertDirectory(insertInformation.getInsertUri(), insertInformation.generateManifestEntries(), "index.html");
/* at this point we might already be stopped. */
if (shouldStop()) {
/* if so, bail out, donât change anything. */
@@ -236,7 +236,9 @@ public class SoneInserter extends AbstractService {
}
}
}
- }
+ } catch (Throwable t1) {
+ logger.log(Level.SEVERE, "SoneInserter threw an Exception!", t1);
+ }}
}
/**
@@ -246,7 +248,7 @@ public class SoneInserter extends AbstractService {
*
* @author David âBombeâ Roden
*/
- private class InsertInformation {
+ private static class InsertInformation {
/** All properties of the Sone, copied for thread safety. */
private final Map soneProperties = new HashMap();