From cfe9a410d9387ee046e181a366ae85f31588248a Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Wed, 15 Dec 2010 03:01:33 +0000 Subject: [PATCH] [MRM-1421] Archiva repository purge incorrectly purges based on file timestamps even when the snapshot timestamp is known git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-1.3.x@1049399 13f79535-47bb-0310-9956-ffa450edef68 --- .../repository/DaysOldRepositoryPurge.java | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurge.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurge.java index bdca2646e..23a62d7f8 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurge.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurge.java @@ -19,6 +19,16 @@ package org.apache.maven.archiva.consumers.core.repository; * under the License. */ +import org.apache.commons.lang.time.DateUtils; +import org.apache.maven.archiva.common.utils.VersionComparator; +import org.apache.maven.archiva.common.utils.VersionUtil; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.repository.ContentNotFoundException; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.events.RepositoryListener; +import org.apache.maven.archiva.repository.layout.LayoutException; + import java.io.File; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -30,16 +40,6 @@ import java.util.List; import java.util.Set; import java.util.regex.Matcher; -import org.apache.commons.lang.time.DateUtils; -import org.apache.maven.archiva.common.utils.VersionComparator; -import org.apache.maven.archiva.common.utils.VersionUtil; -import org.apache.maven.archiva.model.ArtifactReference; -import org.apache.maven.archiva.model.VersionedReference; -import org.apache.maven.archiva.repository.ContentNotFoundException; -import org.apache.maven.archiva.repository.ManagedRepositoryContent; -import org.apache.maven.archiva.repository.events.RepositoryListener; -import org.apache.maven.archiva.repository.layout.LayoutException; - /** * Purge from repository all snapshots older than the specified days in the repository configuration. * @@ -128,10 +128,6 @@ public class DaysOldRepositoryPurge { doPurgeAllRelated( newArtifactReference ); } - else if ( newArtifactFile.lastModified() < olderThanThisDate.getTimeInMillis() ) - { - doPurgeAllRelated( newArtifactReference ); - } } } } -- 2.39.5