🔥 Remove getInsertUri() method from Sone interface
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 11 Feb 2020 17:03:45 +0000 (18:03 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 11 Feb 2020 17:52:31 +0000 (18:52 +0100)
src/main/java/net/pterodactylus/sone/data/Sone.java
src/main/java/net/pterodactylus/sone/data/impl/IdOnlySone.java
src/main/java/net/pterodactylus/sone/data/impl/SoneImpl.java

index b43d025..e2a7b5b 100644 (file)
@@ -192,14 +192,6 @@ public interface Sone extends Identified, Fingerprintable, Comparable<Sone> {
        FreenetURI getRequestUri();
 
        /**
-        * Returns the insert URI of this Sone.
-        *
-        * @return The insert URI of this Sone
-        */
-       @Nullable
-       FreenetURI getInsertUri();
-
-       /**
         * Returns the latest edition of this Sone.
         *
         * @return The latest edition of this Sone
index e06e5a7..ddd96b9 100644 (file)
@@ -53,11 +53,6 @@ public class IdOnlySone implements Sone {
        }
 
        @Override
-       public FreenetURI getInsertUri() {
-               return null;
-       }
-
-       @Override
        public long getLatestEdition() {
                return 0;
        }
index 1069550..ceb05b2 100644 (file)
@@ -46,7 +46,6 @@ import net.pterodactylus.sone.data.SoneOptions;
 import net.pterodactylus.sone.data.SoneOptions.DefaultSoneOptions;
 import net.pterodactylus.sone.database.Database;
 import net.pterodactylus.sone.freenet.wot.Identity;
-import net.pterodactylus.sone.freenet.wot.OwnIdentity;
 
 import freenet.keys.FreenetURI;
 
@@ -191,26 +190,6 @@ public class SoneImpl implements Sone {
        }
 
        /**
-        * Returns the insert URI of this Sone.
-        *
-        * @return The insert URI of this Sone
-        */
-       @Nullable
-       public FreenetURI getInsertUri() {
-               if (!isLocal()) {
-                       return null;
-               }
-               try {
-                       return new FreenetURI(((OwnIdentity) getIdentity()).getInsertUri())
-                                       .setDocName("Sone")
-                                       .setMetaString(new String[0])
-                                       .setSuggestedEdition(latestEdition);
-               } catch (MalformedURLException e) {
-                       throw new IllegalStateException(format("Own identity %s's insert URI is incorrect.", getIdentity()), e);
-               }
-       }
-
-       /**
         * Returns the latest edition of this Sone.
         *
         * @return The latest edition of this Sone