RegisteredPlugin implements Comparable<RegisteredPlugin> { public String getVersion() { if (this.version == null) { final String defaultValue = ""; try (final Jar jar = this.file.getJar()) { if (jar != null) { this.version = jar.getManifestAttributeValue("Plugin-Version", ""); } } catch (IOException e) { LOGGER.log(WARNING, "Error retrieving the version", e); this.version = defaultValue; } } return version; } RegisteredPlugin(PluginFile file); PluginFile getFile(); String getName(); String getVersion(); String getDescription(); String getIconName(); byte[] getIcon(); IPlugin getInstance(); boolean isInstanceOf(final Class<? extends IPlugin> clazz); boolean install(); void uninstall(); boolean isInstalled(); boolean start(); void stop(); boolean isStarted(); @Override int compareTo(RegisteredPlugin o); @Override boolean equals(Object o); @Override int hashCode();  }
@Test void getVersionWhenNotUnzipped() throws IOException { final File plugin = PluginTestUtils.createDummyPlugin("my-plugin", "Awesome plugin", "1.0"); final RegisteredPlugin registeredPlugin = new RegisteredPlugin(new PluginFile(plugin)); assertEquals("1.0", registeredPlugin.getVersion()); }