]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/ArtifactIndexer.java
Introduce repo managers
[gpl/argeo-slc.git] / runtime / org.argeo.slc.repo / src / main / java / org / argeo / slc / repo / ArtifactIndexer.java
index 462739c7d3736274083ba11960cb8ed242003fd3..f62142254bb6a27e7d9cc429804d03fe6ba2ad44 100644 (file)
@@ -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;
+       }
+
 }