public Object newInstance() { return new org.bimserver.interfaces.objects.SPluginBundle(); } }));
SPluginBundle sPluginBundle = new SPluginBundle();
@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); } }
SPluginBundle sPluginBundle = new SPluginBundle(); if (model.getOrganization() == null) { throw new PluginException("Plugis are required to have an organization in the pom.xml file");
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; }
model = mavenreader.read(fileReader); SPluginBundle sPluginBundle = new SPluginBundle();
public SPluginBundle processMavenPluginLocation(MavenPluginLocation mavenPluginLocation, boolean strictVersionChecking, ArtifactVersion bimserverVersion) { SPluginBundle pluginBundle = new SPluginBundle(); boolean usefulBundle = false; Iterator<MavenPluginVersion> iterateAllVersions = mavenPluginLocation.iterateAllVersions();
@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; }