package net.pterodactylus.sone.core;
+import java.io.InputStream;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Collection;
}
/**
+ * Loads a Sone from an input stream.
+ *
+ * @param soneInputStream
+ * The input stream to load the Sone from
+ * @return The parsed Sone, or {@code null} if the Sone could not be parsed
+ */
+ public Sone loadSone(InputStream soneInputStream) {
+ Sone parsedSone = soneDownloader.parseSone(soneInputStream);
+ if (parsedSone == null) {
+ return null;
+ }
+ if (parsedSone.getInsertUri() != null) {
+ addLocalSone(parsedSone);
+ } else {
+ addSone(parsedSone);
+ }
+ return parsedSone;
+ }
+
+ /**
* Loads and updates the given Sone.
*
* @param sone