]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/RepoUtils.java
Rename default artifact base path
[gpl/argeo-slc.git] / runtime / org.argeo.slc.repo / src / main / java / org / argeo / slc / repo / RepoUtils.java
index df8a01daa956db7507cbdd184107e8ff430d02ed..6d22cbe687632ebcff13c7f4df87412ab4e653fd 100644 (file)
@@ -270,6 +270,10 @@ public class RepoUtils implements SlcNames {
                }
        }
 
+       /**
+        * Copy this bytes array as an artifact, relative to the root of the
+        * repository (typically the workspace root node)
+        */
        public static Node copyBytesAsArtifact(Node artifactsBase,
                        Artifact artifact, byte[] bytes) throws RepositoryException {
                String parentPath = MavenConventionsUtils.artifactParentPath(
@@ -279,7 +283,16 @@ public class RepoUtils implements SlcNames {
                return JcrUtils.copyBytesAsFile(folderNode,
                                MavenConventionsUtils.artifactFileName(artifact), bytes);
        }
-       
+
        private RepoUtils() {
        }
+
+       /** If a source return the base bundle name, does not change otherwise */
+       public static String extractBundleNameFromSourceName(String sourceBundleName) {
+               if (sourceBundleName.endsWith(".source"))
+                       return sourceBundleName.substring(0, sourceBundleName.length()
+                                       - ".source".length());
+               else
+                       return sourceBundleName;
+       }
 }