/** * Returns true if the plugin identified by the given coordinates is a * snapshot plugin. * @param coordinates the plugin coordinates * @return true if the given plugin is a snapshot */ public static boolean isSnapshot(PluginCoordinates coordinates) { return coordinates.getVersion().endsWith("-SNAPSHOT"); //$NON-NLS-1$ }
/** * Returns true if the plugin identified by the given coordinates is a * snapshot plugin. * @param coordinates the plugin coordinates * @return true if the given plugin is a snapshot */ public static boolean isSnapshot(PluginCoordinates coordinates) { return coordinates.getVersion().endsWith("-SNAPSHOT"); //$NON-NLS-1$ }
/** * Calculates the relative path of the artifact from the given coordinates. * @param coordinates the coordinates * @return the maven path */ public static String getMavenPath(PluginCoordinates coordinates) { StringBuilder artifactSubPath = new StringBuilder(); artifactSubPath.append(coordinates.getGroupId().replace('.', '/')); artifactSubPath.append('/'); artifactSubPath.append(coordinates.getArtifactId()); artifactSubPath.append('/'); artifactSubPath.append(coordinates.getVersion()); artifactSubPath.append('/'); artifactSubPath.append(coordinates.getArtifactId()); artifactSubPath.append('-'); artifactSubPath.append(coordinates.getVersion()); if (coordinates.getClassifier() != null) { artifactSubPath.append('-'); artifactSubPath.append(coordinates.getClassifier()); } artifactSubPath.append('.'); artifactSubPath.append(coordinates.getType()); return artifactSubPath.toString(); }
/** * Calculates the relative path of the artifact from the given coordinates. * @param coordinates the coordinates * @return the maven path */ public static String getMavenPath(PluginCoordinates coordinates) { StringBuilder artifactSubPath = new StringBuilder(); artifactSubPath.append(coordinates.getGroupId().replace('.', '/')); artifactSubPath.append('/'); artifactSubPath.append(coordinates.getArtifactId()); artifactSubPath.append('/'); artifactSubPath.append(coordinates.getVersion()); artifactSubPath.append('/'); artifactSubPath.append(coordinates.getArtifactId()); artifactSubPath.append('-'); artifactSubPath.append(coordinates.getVersion()); if (coordinates.getClassifier() != null) { artifactSubPath.append('-'); artifactSubPath.append(coordinates.getClassifier()); } artifactSubPath.append('.'); artifactSubPath.append(coordinates.getType()); return artifactSubPath.toString(); }
/** * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append(getGroupId()); builder.append(':'); builder.append(getArtifactId()); builder.append(':'); builder.append(getVersion()); if (getClassifier() != null) { builder.append('-').append(getClassifier()); } builder.append(':'); if (getType() == null) { builder.append("war"); //$NON-NLS-1$ } else { builder.append(getType()); } return builder.toString(); }
/** * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append(getGroupId()); builder.append(':'); builder.append(getArtifactId()); builder.append(':'); builder.append(getVersion()); if (getClassifier() != null) { builder.append('-').append(getClassifier()); } builder.append(':'); if (getType() == null) { builder.append("war"); //$NON-NLS-1$ } else { builder.append(getType()); } return builder.toString(); }
/** * Returns the relative path (within a plugin registry's plugins directory) where * the plugin with the given coordinates can be found. For example, if the plugin * coordinate are "io.apiman.sample:sample-plugin:1.0.1:classifier:war" then the * path will be: * * io.apiman.sample/sample-plugin/1.0.1/sample-plugin-classifier.war/ * * @param coordinates the coordinates * @return plugin's relative path */ public static String getPluginRelativePath(PluginCoordinates coordinates) { StringBuilder pluginRelativePath = new StringBuilder(); pluginRelativePath.append(coordinates.getGroupId()); pluginRelativePath.append("/"); //$NON-NLS-1$ pluginRelativePath.append(coordinates.getArtifactId()); pluginRelativePath.append("/"); //$NON-NLS-1$ pluginRelativePath.append(coordinates.getVersion()); pluginRelativePath.append("/"); //$NON-NLS-1$ pluginRelativePath.append(coordinates.getArtifactId()); if (coordinates.getClassifier() != null) { pluginRelativePath.append("-").append(coordinates.getClassifier()); //$NON-NLS-1$ } pluginRelativePath.append("."); //$NON-NLS-1$ pluginRelativePath.append(coordinates.getType()); return pluginRelativePath.toString(); }
/** * Returns the relative path (within a plugin registry's plugins directory) where * the plugin with the given coordinates can be found. For example, if the plugin * coordinate are "io.apiman.sample:sample-plugin:1.0.1:classifier:war" then the * path will be: * * io.apiman.sample/sample-plugin/1.0.1/sample-plugin-classifier.war/ * * @param coordinates the coordinates * @return plugin's relative path */ public static String getPluginRelativePath(PluginCoordinates coordinates) { StringBuilder pluginRelativePath = new StringBuilder(); pluginRelativePath.append(coordinates.getGroupId()); pluginRelativePath.append("/"); //$NON-NLS-1$ pluginRelativePath.append(coordinates.getArtifactId()); pluginRelativePath.append("/"); //$NON-NLS-1$ pluginRelativePath.append(coordinates.getVersion()); pluginRelativePath.append("/"); //$NON-NLS-1$ pluginRelativePath.append(coordinates.getArtifactId()); if (coordinates.getClassifier() != null) { pluginRelativePath.append("-").append(coordinates.getClassifier()); //$NON-NLS-1$ } pluginRelativePath.append("."); //$NON-NLS-1$ pluginRelativePath.append(coordinates.getType()); return pluginRelativePath.toString(); }