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=f62142254bb6a27e7d9cc429804d03fe6ba2ad44;hb=d5b315ae97d554676a77bd0e4476446da2a78264;hp=462739c7d3736274083ba11960cb8ed242003fd3;hpb=8ade4ac045a4d001ecb057f61e913f56b1d5dbb6;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 462739c7d..f62142254 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 @@ -34,6 +34,7 @@ import org.sonatype.aether.artifact.Artifact; */ public class ArtifactIndexer implements NodeIndexer { private Log log = LogFactory.getLog(ArtifactIndexer.class); + private Boolean force = false; public Boolean support(String path) { String relativePath = getRelativePath(path); @@ -52,9 +53,13 @@ public class ArtifactIndexer implements NodeIndexer { public void index(Node fileNode) { Artifact artifact = null; try { - if(!support(fileNode.getPath())) + if (!support(fileNode.getPath())) return; - + + // Already indexed + if (!force && fileNode.isNodeType(SlcTypes.SLC_ARTIFACT)) + return; + if (!fileNode.isNodeType(NodeType.NT_FILE)) return; @@ -148,4 +153,9 @@ public class ArtifactIndexer implements NodeIndexer { String relativePath = nodePath.substring(basePath.length()); return relativePath; } + + public void setForce(Boolean force) { + this.force = force; + } + }