+ /* load all known Sones. */
+ int knownSonesCounter = 0;
+ while (true) {
+ String knownSonePrefix = "KnownSone." + knownSonesCounter++;
+ String knownSoneId = configuration.getStringValue(knownSonePrefix + "/ID").getValue(null);
+ if (knownSoneId == null) {
+ break;
+ }
+ String knownSoneName = configuration.getStringValue(knownSonePrefix + "/Name").getValue(null);
+ String knownSoneKey = configuration.getStringValue(knownSonePrefix + "/Key").getValue(null);
+ try {
+ getSone(knownSoneId).setName(knownSoneName).setRequestUri(new FreenetURI(knownSoneKey));
+ } catch (MalformedURLException mue1) {
+ logger.log(Level.WARNING, "Could not create Sone from requestUri (“" + knownSoneKey + "”)!", mue1);
+ }
+ }
+
+ /* load all blacklisted Sones. */
+ int blacklistedSonesCounter = 0;
+ while (true) {
+ String blacklistedSonePrefix = "BlacklistedSone." + blacklistedSonesCounter++;
+ String blacklistedSoneId = configuration.getStringValue(blacklistedSonePrefix + "/ID").getValue(null);
+ if (blacklistedSoneId == null) {
+ break;
+ }
+ String blacklistedSoneName = configuration.getStringValue(blacklistedSonePrefix + "/Name").getValue(null);
+ String blacklistedSoneKey = configuration.getStringValue(blacklistedSonePrefix + "/Key").getValue(null);
+ String blacklistedSoneInsertKey = configuration.getStringValue(blacklistedSonePrefix + "/InsertKey").getValue(null);
+ try {
+ blacklistSone(getSone(blacklistedSoneId).setName(blacklistedSoneName).setRequestUri(new FreenetURI(blacklistedSoneKey)).setInsertUri((blacklistedSoneInsertKey != null) ? new FreenetURI(blacklistedSoneInsertKey) : null));
+ } catch (MalformedURLException mue1) {
+ logger.log(Level.WARNING, "Could not create blacklisted Sone from requestUri (“" + blacklistedSoneKey + "”)!", mue1);
+ }
+ }
+
+ /* load all remote Sones. */
+ for (Sone remoteSone : getRemoteSones()) {
+ loadSone(remoteSone);
+ }
+