X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=runtime%2Forg.argeo.slc.repo%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Frepo%2FRepoUtils.java;h=6d22cbe687632ebcff13c7f4df87412ab4e653fd;hb=aeaa45c7cfbb4f2376a4ec02e6dd71d711a52c5b;hp=df8a01daa956db7507cbdd184107e8ff430d02ed;hpb=6100175ea489062df9ad9a47fb5bbbb904595b2f;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/RepoUtils.java b/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/RepoUtils.java index df8a01daa..6d22cbe68 100644 --- a/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/RepoUtils.java +++ b/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/RepoUtils.java @@ -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; + } }