RegisteredPlugin implements Comparable<RegisteredPlugin> { public String getName() { if (this.name == null) { final String defaultValue = this.file.getNameOnly(); try (final Jar jar = this.file.getJar()) { if (jar != null) { this.name = jar.getManifestAttributeValue("Plugin-Name", this.file.getNameOnly()); } } catch (IOException e) { LOGGER.log(WARNING, "Error retrieving the name", e); this.name = defaultValue; } } return name; } 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 getNameWhenNotUnzipped() throws IOException { final File plugin = PluginTestUtils.createDummyPlugin("my-plugin", "Awesome plugin", "1.0"); final RegisteredPlugin registeredPlugin = new RegisteredPlugin(new PluginFile(plugin)); assertEquals("Awesome plugin", registeredPlugin.getName()); }