sPluginBundle.setName(model.getName());
@Override public SPluginBundle getPluginBundle() { SPluginBundle result = new SPluginBundle(); result.setName(model.getName()); result.setOrganization(model.getOrganization().getName()); return result; }
public SPluginBundle extractPluginBundleFromJar(Path jarFilePath) throws PluginException { String filename = jarFilePath.getFileName().toString(); PluginBundleVersionIdentifier pluginBundleVersionIdentifier = PluginBundleVersionIdentifier.fromFileName(filename); try (JarFile jarFile = new JarFile(jarFilePath.toFile())) { String pomLocation = "META-INF/maven/" + pluginBundleVersionIdentifier.getPluginBundleIdentifier().getGroupId() + "/" + pluginBundleVersionIdentifier.getPluginBundleIdentifier().getArtifactId() + "/" + "pom.xml"; ZipEntry pomEntry = jarFile.getEntry(pomLocation); if (pomEntry == null) { throw new PluginException("No pom.xml found in JAR file " + jarFilePath.toString() + ", " + pomLocation); } MavenXpp3Reader mavenreader = new MavenXpp3Reader(); Model model = mavenreader.read(jarFile.getInputStream(pomEntry)); SPluginBundle sPluginBundle = new SPluginBundle(); sPluginBundle.setOrganization(model.getOrganization().getName()); sPluginBundle.setName(model.getName()); return sPluginBundle; } catch (IOException e) { throw new PluginException(e); } catch (XmlPullParserException e) { throw new PluginException(e); } }
setName((String)val); return;
sPluginBundle.setName(model.getName());
public SPluginBundle convertToSObject(PluginBundle input) { if (input == null) { return null; } SPluginBundle result = new SPluginBundle(); result.setOid(input.getOid()); result.setRid(input.getRid()); result.setOrganization(input.getOrganization()); result.setName(input.getName()); PluginBundleVersion latestVersionVal = input.getLatestVersion(); result.setLatestVersion(convertToSObject(latestVersionVal)); List<SPluginBundleVersion> listavailableVersions = new ArrayList<SPluginBundleVersion>(); for (PluginBundleVersion v : input.getAvailableVersions()) { listavailableVersions.add(convertToSObject(v)); } result.setAvailableVersions(listavailableVersions); PluginBundleVersion installedVersionVal = input.getInstalledVersion(); result.setInstalledVersion(convertToSObject(installedVersionVal)); return result; }
sPluginBundle.setName(model.getName());
sPluginBundleVersion.setDescription(mavenPluginVersion.getModel().getDescription()); pluginBundle.setName(mavenPluginVersion.getModel().getName()); pluginBundle.setOrganization(mavenPluginVersion.getModel().getOrganization().getName()); if (pluginBundle.getLatestVersion() == null) {
@Override public SPluginBundle getPluginBundle() { SPluginBundle result = new SPluginBundle(); result.setName(sPluginBundle.getName()); result.setOrganization(sPluginBundle.getOrganization()); if (sPluginBundle.getInstalledVersion() != null) { SPluginBundleVersion installedVersion = new SPluginBundleVersion(); installedVersion.setArtifactId(sPluginBundle.getInstalledVersion().getArtifactId()); installedVersion.setDescription(sPluginBundle.getInstalledVersion().getDescription()); installedVersion.setGroupId(sPluginBundle.getInstalledVersion().getGroupId()); installedVersion.setIcon(sPluginBundle.getInstalledVersion().getIcon()); installedVersion.setMismatch(sPluginBundle.getInstalledVersion().isMismatch()); installedVersion.setName(sPluginBundle.getInstalledVersion().getName()); installedVersion.setOrganization(sPluginBundle.getInstalledVersion().getOrganization()); installedVersion.setRepository(sPluginBundle.getInstalledVersion().getRepository()); installedVersion.setType(sPluginBundle.getInstalledVersion().getType()); installedVersion.setVersion(sPluginBundle.getInstalledVersion().getVersion()); result.setInstalledVersion(installedVersion); } return result; }