X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.repo%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Frepo%2FArtifactIndexer.java;h=a0f0be25ba2ca4ed4efb65932c410cff02c778e3;hb=142bc73155f308b5e0dd5e9ae4f505db0ca21eec;hp=fe8c00d2517d937af7e470a8ef8e917ba1ae20fa;hpb=74904a755b5b344238eafa798419b80c5e74f7ed;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/ArtifactIndexer.java b/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/ArtifactIndexer.java index fe8c00d25..a0f0be25b 100644 --- a/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/ArtifactIndexer.java +++ b/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/ArtifactIndexer.java @@ -73,6 +73,14 @@ public class ArtifactIndexer implements NodeIndexer { artifact.getClassifier()); JcrUtils.updateLastModified(fileNode); + // make sure there is a checksum + String shaNodeName = fileNode.getName() + ".sha1"; + if (!fileNode.getParent().hasNode(shaNodeName)) { + String sha = JcrUtils.checksumFile(fileNode, "SHA-1"); + JcrUtils.copyBytesAsFile(fileNode.getParent(), shaNodeName, + sha.getBytes()); + } + // set higher levels Node artifactVersionBase = fileNode.getParent(); if (!artifactVersionBase @@ -114,7 +122,7 @@ public class ArtifactIndexer implements NodeIndexer { artifact.getGroupId()); } JcrUtils.updateLastModifiedAndParents(groupBase, - RepoConstants.ARTIFACTS_BASE_PATH); + RepoConstants.DEFAULT_ARTIFACTS_BASE_PATH); if (log.isTraceEnabled()) log.trace("Indexed artifact " + artifact + " on " + fileNode); @@ -125,7 +133,7 @@ public class ArtifactIndexer implements NodeIndexer { } private String getRelativePath(String nodePath) { - String basePath = RepoConstants.ARTIFACTS_BASE_PATH; + String basePath = RepoConstants.DEFAULT_ARTIFACTS_BASE_PATH; if (!nodePath.startsWith(basePath)) return null; String relativePath = nodePath.substring(basePath.length());