Add org.argeo.slc.repo.RepoUtils.relatedPdeSourcePath(String, Node)
authorMathieu Baudier <mbaudier@argeo.org>
Mon, 18 Mar 2013 15:49:58 +0000 (15:49 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Mon, 18 Mar 2013 15:49:58 +0000 (15:49 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@6156 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/RepoUtils.java

index 3d7d5920d04cffa6b7524cd864a7b427d37e9c67..f00c910a423e3bec98d244d8add164bf55813801 100644 (file)
@@ -311,6 +311,22 @@ public class RepoUtils implements ArgeoNames, SlcNames {
                }
        }
 
+       /**
+        * The path to the PDE source related to this artifact (or artifact version
+        * base). There may or there may not be a node at this location (the
+        * returned path will typically be used to test whether PDE sources are
+        * attached to this artifact).
+        */
+       public static String relatedPdeSourcePath(String artifactBasePath,
+                       Node artifactNode) throws RepositoryException {
+               Artifact artifact = asArtifact(artifactNode);
+               Artifact pdeSourceArtifact = new DefaultArtifact(artifact.getGroupId(),
+                               artifact.getArtifactId() + ".source", artifact.getExtension(),
+                               artifact.getVersion());
+               return MavenConventionsUtils.artifactPath(artifactBasePath,
+                               pdeSourceArtifact);
+       }
+
        /**
         * Copy this bytes array as an artifact, relative to the root of the
         * repository (typically the workspace root node)