summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base/archiva-indexer
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2013-12-16 06:53:27 +0000
committerOlivier Lamy <olamy@apache.org>2013-12-16 06:53:27 +0000
commit28898793f51c03b1259d3a1b1f1612f450cf634c (patch)
treeea881bdcdd181731e1056654106ecd6f477714c9 /archiva-modules/archiva-base/archiva-indexer
parentc2d4f8bce1588f39ed80078c89939b3df746f9be (diff)
downloadarchiva-28898793f51c03b1259d3a1b1f1612f450cf634c.tar.gz
archiva-28898793f51c03b1259d3a1b1f1612f450cf634c.zip
start refactoring merging remote indexes to have a cron job doing it
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1551122 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-indexer')
-rw-r--r--archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java4
-rw-r--r--archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/IndexMergerRequest.java33
2 files changed, 30 insertions, 7 deletions
diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java
index beccab06e..4a939cb49 100644
--- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java
+++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java
@@ -80,8 +80,8 @@ public class DefaultIndexMerger
StopWatch stopWatch = new StopWatch();
stopWatch.reset();
stopWatch.start();
- File tempRepoFile = Files.createTempDir();
- tempRepoFile.deleteOnExit();
+
+ File tempRepoFile = indexMergerRequest.getMergedIndexDirectory();
String tempRepoId = tempRepoFile.getName();
diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/IndexMergerRequest.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/IndexMergerRequest.java
index a7a3b656f..e99e3d562 100644
--- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/IndexMergerRequest.java
+++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/IndexMergerRequest.java
@@ -18,6 +18,7 @@ package org.apache.archiva.indexer.merger;
* under the License.
*/
+import java.io.File;
import java.util.Collection;
/**
@@ -44,6 +45,8 @@ public class IndexMergerRequest
private int mergedIndexTtl;
+ private File mergedIndexDirectory;
+
public IndexMergerRequest( Collection<String> repositoriesIds, boolean packIndex, String groupId )
{
this.repositoriesIds = repositoriesIds;
@@ -54,8 +57,8 @@ public class IndexMergerRequest
/**
* @since 1.4-M4
*/
- public IndexMergerRequest(Collection<String> repositoriesIds, boolean packIndex, String groupId,
- String mergedIndexPath, int mergedIndexTtl)
+ public IndexMergerRequest( Collection<String> repositoriesIds, boolean packIndex, String groupId,
+ String mergedIndexPath, int mergedIndexTtl )
{
this.repositoriesIds = repositoriesIds;
this.packIndex = packIndex;
@@ -104,14 +107,33 @@ public class IndexMergerRequest
this.mergedIndexPath = mergedIndexPath;
}
- public int getMergedIndexTtl() {
+ public int getMergedIndexTtl()
+ {
return mergedIndexTtl;
}
- public void setMergedIndexTtl(int mergedIndexTtl) {
+ public void setMergedIndexTtl( int mergedIndexTtl )
+ {
this.mergedIndexTtl = mergedIndexTtl;
}
+ public File getMergedIndexDirectory()
+ {
+ return mergedIndexDirectory;
+ }
+
+ public void setMergedIndexDirectory( File mergedIndexDirectory )
+ {
+ this.mergedIndexDirectory = mergedIndexDirectory;
+ }
+
+ public IndexMergerRequest mergedIndexDirectory( File mergedIndexDirectory )
+ {
+ this.mergedIndexDirectory = mergedIndexDirectory;
+ return this;
+ }
+
+
@Override
public String toString()
{
@@ -120,7 +142,8 @@ public class IndexMergerRequest
sb.append( ", packIndex=" ).append( packIndex );
sb.append( ", groupId='" ).append( groupId ).append( '\'' );
sb.append( ", mergedIndexPath='" ).append( mergedIndexPath ).append( '\'' );
- sb.append( ", mergedIndexTtl='" ).append( mergedIndexTtl ).append( '\'' );
+ sb.append( ", mergedIndexTtl=" ).append( mergedIndexTtl );
+ sb.append( ", mergedIndexDirectory='" ).append( mergedIndexDirectory ).append( '\'' );
sb.append( '}' );
return sb.toString();
}