@Override public String toString() { return comparable.toString(); } }
@Override public String toString() { return comparable.toString(); } }
language = Language.JAVA; fromVersion = new ComparableVersion(matchedEmbulkCoreInGradle.get(0).group(1).replace("+", "0")); System.out.printf("Detected Java plugin for Embulk %s...\n", fromVersion.toString()); } else if (!matchedNewEmbulkInGemspec.isEmpty()) { language = Language.RUBY; fromVersion = new ComparableVersion(matchedNewEmbulkInGemspec.get(0).group(1)); System.out.printf("Detected Ruby plugin for Embulk %s...\n", fromVersion.toString()); } else if (!matchedOldEmbulkInGemspec.isEmpty()) { language = Language.RUBY;
System.out.println( " " + prev.toString() + ' ' + ( ( compare == 0 ) ? "==" : ( ( compare < 0 ) ? "<" : ">" ) ) + ' ' + version );
System.out.println( " " + prev.toString() + ' ' + ( ( compare == 0 ) ? "==" : ( ( compare < 0 ) ? "<" : ">" ) ) + ' ' + version );
@Override public String toString() { return this.delegate.toString(); }
@Override public String toString() { return this.delegate.toString(); }
@Override public void writeExternal(ObjectOutput out) throws IOException { out.writeUTF(delegate.toString()); }
@Override public void writeExternal(ObjectOutput out) throws IOException { out.writeUTF(delegate.toString()); }
System.out.println( " " + prev.toString() + ' ' + ( ( compare == 0 ) ? "==" : ( ( compare < 0 ) ? "<" : ">" ) ) + ' ' + version );
public Collection<String> findVersions(String groupId, String artifactId, String searchExpression, Packaging packaging) { try { Collection<IndexedArtifact> values = index.find(new MatchTypedStringSearchExpression(groupId, MatchType.EXACT), new MatchTypedStringSearchExpression(artifactId, MatchType.EXACT), null, packaging.toSearchExpression()); if(values.isEmpty()) { return Collections.emptySet(); } TreeSet<String> ids = new TreeSet<String>(); Set<IndexedArtifactFile> files = values.iterator().next().getFiles(); for(IndexedArtifactFile artifactFile : files) { ids.add(artifactFile.version); } Collection<String> result = subSet(ids, searchExpression); // sort results according to o.a.m.artifact.versioning.ComparableVersion SortedSet<ComparableVersion> versions = new TreeSet<ComparableVersion>(); for(String version : result) { versions.add(new ComparableVersion(version)); } result = null; // not used any more List<String> sorted = new ArrayList<String>(versions.size()); for(ComparableVersion version : versions) { sorted.add(version.toString()); } versions = null; // not used any more Collections.reverse(sorted); return sorted; } catch(CoreException ex) { throw new SearchException(ex.getMessage(), ex.getStatus().getException()); } }
return new InstallerFqn(installerFqn.getId(), latestVersion.get().toString());
/** * Creates a {@link Plugin} object for the given plugin jar and caches it. * @param pluginJar information about this plugin jar will be cached * @param md5 if known, this is the plugin jar's MD5, <code>null</code> if not known * @return the plugin jar files's information that has been cached * @throws Exception if failed to get information about the plugin */ private Plugin cacheFilesystemAgentPluginJar(File pluginJar, String md5) throws Exception { if (md5 == null) { // don't calculate the MD5 is we've already done it before md5 = MessageDigestGenerator.getDigestString(pluginJar); } URL pluginUrl = pluginJar.toURI().toURL(); PluginDescriptor descriptor = AgentPluginDescriptorUtil.loadPluginDescriptorFromUrl(pluginUrl); String version = AgentPluginDescriptorUtil.getPluginVersion(pluginJar, descriptor).toString(); String name = descriptor.getName(); Plugin plugin = new Plugin(name, pluginJar.getName()); plugin.setMd5(md5); plugin.setVersion(version); plugin.setMtime(pluginJar.lastModified()); this.agentPluginsOnFilesystem.put(pluginJar, plugin); return plugin; }
/** * Creates a {@link ServerPlugin} object for the given plugin jar and caches it. * @param pluginJar information about this plugin jar will be cached * @param md5 if known, this is the plugin jar's MD5, <code>null</code> if not known * @return the plugin jar file's information that has been cached * @throws Exception if failed to get information about the plugin */ private ServerPlugin cacheFilesystemServerPluginJar(File pluginJar, @Nullable String md5) throws Exception { if (md5 == null) { // don't calculate the MD5 is we've already done it before md5 = MessageDigestGenerator.getDigestString(pluginJar); } URL pluginUrl = pluginJar.toURI().toURL(); ServerPluginDescriptorType descriptor = ServerPluginDescriptorUtil.loadPluginDescriptorFromUrl(pluginUrl); String version = ServerPluginDescriptorUtil.getPluginVersion(pluginJar, descriptor).toString(); String name = descriptor.getName(); ServerPlugin plugin = new ServerPlugin(name, pluginJar.getName()); plugin.setType(new ServerPluginType(descriptor).stringify()); plugin.setMd5(md5); plugin.setVersion(version); plugin.setMtime(pluginJar.lastModified()); this.serverPluginsOnFilesystem.put(pluginJar, new PluginWithDescriptor(plugin, descriptor)); return plugin; }
String pluginNameDisplayName = pluginName + " (" + displayName + ")"; ComparableVersion comparableVersion = this.pluginVersions.get(pluginName); String version = (comparableVersion != null) ? comparableVersion.toString() : null; log.debug("Registering RHQ plugin " + pluginNameDisplayName + ", " + ((version != null) ? "version " + version : "undefined version") + "...");
plugin.setDescription(descriptor.getDescription()); plugin.setMtime(pluginFile.lastModified()); plugin.setVersion(version.toString()); plugin.setAmpsVersion(descriptor.getApiVersion()); plugin.setMD5(MessageDigestGenerator.getDigestString(pluginFile));