Don’t set insert URI of a Sone, let it be generated from the identity.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / SoneInserter.java
index 9fad053..9f1f164 100644 (file)
@@ -17,7 +17,6 @@
 
 package net.pterodactylus.sone.core;
 
 
 package net.pterodactylus.sone.core;
 
-import static com.google.common.base.Preconditions.checkArgument;
 import static java.lang.String.format;
 import static java.lang.System.currentTimeMillis;
 import static net.pterodactylus.sone.data.Album.NOT_EMPTY;
 import static java.lang.String.format;
 import static java.lang.System.currentTimeMillis;
 import static net.pterodactylus.sone.data.Album.NOT_EMPTY;
@@ -229,7 +228,7 @@ public class SoneInserter extends AbstractService {
                                                sone.setStatus(SoneStatus.inserting);
                                                long insertTime = currentTimeMillis();
                                                eventBus.post(new SoneInsertingEvent(sone));
                                                sone.setStatus(SoneStatus.inserting);
                                                long insertTime = currentTimeMillis();
                                                eventBus.post(new SoneInsertingEvent(sone));
-                                               FreenetURI finalUri = freenetInterface.insertDirectory(insertInformation.getInsertUri(), insertInformation.generateManifestEntries(), "index.html");
+                                               FreenetURI finalUri = freenetInterface.insertDirectory(sone.getInsertUri(), insertInformation.generateManifestEntries(), "index.html");
                                                eventBus.post(new SoneInsertedEvent(sone, currentTimeMillis() - insertTime));
                                                /* at this point we might already be stopped. */
                                                if (shouldStop()) {
                                                eventBus.post(new SoneInsertedEvent(sone, currentTimeMillis() - insertTime));
                                                /* at this point we might already be stopped. */
                                                if (shouldStop()) {
@@ -304,7 +303,6 @@ public class SoneInserter extends AbstractService {
                        soneProperties.put("name", sone.getName());
                        soneProperties.put("time", currentTimeMillis());
                        soneProperties.put("requestUri", sone.getRequestUri());
                        soneProperties.put("name", sone.getName());
                        soneProperties.put("time", currentTimeMillis());
                        soneProperties.put("requestUri", sone.getRequestUri());
-                       soneProperties.put("insertUri", sone.getInsertUri());
                        soneProperties.put("profile", sone.getProfile());
                        soneProperties.put("posts", Ordering.from(Post.TIME_COMPARATOR).sortedCopy(sone.getPosts()));
                        soneProperties.put("replies", Ordering.from(Reply.TIME_COMPARATOR).reverse().sortedCopy(sone.getReplies()));
                        soneProperties.put("profile", sone.getProfile());
                        soneProperties.put("posts", Ordering.from(Post.TIME_COMPARATOR).sortedCopy(sone.getPosts()));
                        soneProperties.put("replies", Ordering.from(Reply.TIME_COMPARATOR).reverse().sortedCopy(sone.getReplies()));
@@ -322,15 +320,6 @@ public class SoneInserter extends AbstractService {
                        return fingerprint;
                }
 
                        return fingerprint;
                }
 
-               /**
-                * Returns the insert URI of the Sone.
-                *
-                * @return The insert URI of the Sone
-                */
-               public FreenetURI getInsertUri() {
-                       return (FreenetURI) soneProperties.get("insertUri");
-               }
-
                //
                // ACTIONS
                //
                //
                // ACTIONS
                //