X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffreenet%2FPluginStoreConfigurationBackend.java;h=eec8aa33c95a1b434e7a0f6301db35e59fd60f72;hp=0ed6dd59cd33b6c95c39fb3edc7e037380aa376f;hb=3a7092e48f27cba6286946442783f539ad73a911;hpb=43740d6a1dfc686ab54d0aebd4a5b1bce75b9ed6 diff --git a/src/main/java/net/pterodactylus/sone/freenet/PluginStoreConfigurationBackend.java b/src/main/java/net/pterodactylus/sone/freenet/PluginStoreConfigurationBackend.java index 0ed6dd5..eec8aa3 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/PluginStoreConfigurationBackend.java +++ b/src/main/java/net/pterodactylus/sone/freenet/PluginStoreConfigurationBackend.java @@ -25,7 +25,7 @@ import net.pterodactylus.util.config.AttributeNotFoundException; import net.pterodactylus.util.config.Configuration; import net.pterodactylus.util.config.ConfigurationException; import net.pterodactylus.util.config.ExtendedConfigurationBackend; -import freenet.client.async.DatabaseDisabledException; +import freenet.client.async.PersistenceDisabledException; import freenet.pluginmanager.PluginRespirator; import freenet.pluginmanager.PluginStore; @@ -38,7 +38,7 @@ public class PluginStoreConfigurationBackend implements ExtendedConfigurationBac /** The logger. */ @SuppressWarnings("unused") - private static final Logger logger = getLogger("Sone.Fred"); + private static final Logger logger = getLogger(PluginStoreConfigurationBackend.class.getName()); /** The plugin respirator. */ private final PluginRespirator pluginRespirator; @@ -51,15 +51,12 @@ public class PluginStoreConfigurationBackend implements ExtendedConfigurationBac * * @param pluginRespirator * The plugin respirator - * @throws DatabaseDisabledException + * @throws PersistenceDisabledException * if the plugin store is not available */ - public PluginStoreConfigurationBackend(PluginRespirator pluginRespirator) throws DatabaseDisabledException { + public PluginStoreConfigurationBackend(PluginRespirator pluginRespirator) throws PersistenceDisabledException { this.pluginRespirator = pluginRespirator; this.pluginStore = pluginRespirator.getStore(); - if (this.pluginStore == null) { - throw new DatabaseDisabledException(); - } } /** @@ -177,8 +174,8 @@ public class PluginStoreConfigurationBackend implements ExtendedConfigurationBac public void save() throws ConfigurationException { try { pluginRespirator.putStore(pluginStore); - } catch (DatabaseDisabledException dde1) { - throw new ConfigurationException("Could not store plugin store, database is disabled.", dde1); + } catch (PersistenceDisabledException pde1) { + throw new ConfigurationException("Could not store plugin store, persistence is disabled.", pde1); } }