/*
- * Sone - SonePlugin.java - Copyright © 2010–2015 David Roden
+ * Sone - SonePlugin.java - Copyright © 2010–2016 David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
import freenet.client.async.PersistenceDisabledException;
import freenet.l10n.BaseL10n.LANGUAGE;
import freenet.l10n.PluginL10n;
-import freenet.node.Node;
import freenet.pluginmanager.FredPlugin;
import freenet.pluginmanager.FredPluginBaseL10n;
import freenet.pluginmanager.FredPluginFCP;
}
/** The version. */
- public static final Version VERSION = new Version(0, 9, 4);
+ private static final Version VERSION = new Version(0, 9, 6);
/** The current year at time of release. */
- private static final int YEAR = 2015;
+ private static final int YEAR = 2016;
private static final String SONE_HOMEPAGE = "USK@nwa8lHa271k2QvJ8aa0Ov7IHAV-DFOCFgmDt3X6BpCI,DuQSUZiI~agF8c-6tjsFFGuZ8eICrzWCILB60nT8KKo,AQACAAE/sone/";
- private static final int LATEST_EDITION = 71;
+ private static final int LATEST_EDITION = 73;
/** The logger. */
private static final Logger logger = getLogger(SonePlugin.class.getName());
return l10n;
}
+ public static String getPluginVersion() {
+ return VERSION.toString();
+ }
+
public static int getYear() {
return YEAR;
}
final EventBus eventBus = new EventBus();
/* Freenet injector configuration. */
- AbstractModule freenetModule = new AbstractModule() {
+ FreenetModule freenetModule = new FreenetModule(pluginRespirator);
- @Override
- @SuppressWarnings("synthetic-access")
- protected void configure() {
- bind(PluginRespirator.class).toInstance(SonePlugin.this.pluginRespirator);
- bind(Node.class).toInstance(SonePlugin.this.pluginRespirator.getNode());
- }
- };
/* Sone injector configuration. */
AbstractModule soneModule = new AbstractModule() {
bind(getOptionalContextTypeLiteral()).toInstance(of(context));
bind(SonePlugin.class).toInstance(SonePlugin.this);
bind(Version.class).toInstance(VERSION);
+ bind(PluginVersion.class).toInstance(new PluginVersion(getVersion()));
+ bind(PluginYear.class).toInstance(new PluginYear(getYear()));
+ bind(PluginHomepage.class).toInstance(new PluginHomepage(getHomepage()));
if (startConfiguration.getBooleanValue("Developer.LoadFromFilesystem").getValue(false)) {
String path = startConfiguration.getStringValue("Developer.FilesystemPath").getValue(null);
if (path != null) {
return VERSION.toString();
}
+ public static class PluginVersion {
+
+ private final String version;
+
+ public PluginVersion(String version) {
+ this.version = version;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ }
+
+ public static class PluginYear {
+
+ private final int year;
+
+ public PluginYear(int year) {
+ this.year = year;
+ }
+
+ public int getYear() {
+ return year;
+ }
+
+ }
+
+ public static class PluginHomepage {
+
+ private final String homepage;
+
+ public PluginHomepage(String homepage) {
+ this.homepage = homepage;
+ }
+
+ public String getHomepage() {
+ return homepage;
+ }
+
+ }
+
}