aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers
diff options
context:
space:
mode:
authorMartin Stockhammer <martin_s@apache.org>2020-02-10 23:21:32 +0100
committerMartin Stockhammer <martin_s@apache.org>2020-02-10 23:21:32 +0100
commitf6f495d494ac2607ae1f850920673c4f64b241cf (patch)
treeb080d94e34448c7a792f7b08022e58032e4656f6 /archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers
parent13856a6060f158ca5fac07d2269adb7fdfd87aef (diff)
downloadarchiva-f6f495d494ac2607ae1f850920673c4f64b241cf.tar.gz
archiva-f6f495d494ac2607ae1f850920673c4f64b241cf.zip
Refactoring ManagedRepositoryContent
Diffstat (limited to 'archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers')
-rw-r--r--archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java4
-rw-r--r--archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java4
-rw-r--r--archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurge.java8
-rw-r--r--archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java7
4 files changed, 20 insertions, 3 deletions
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java
index 6df43d78c..a8daf16a2 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java
@@ -234,6 +234,10 @@ public abstract class AbstractRepositoryPurge
{
log.warn( "skip error deleting artifact {}: {}", reference, e.getMessage( ) );
}
+ catch ( org.apache.archiva.repository.ContentAccessException e )
+ {
+ e.printStackTrace( );
+ }
boolean snapshotVersion = VersionUtil.isSnapshot( reference.getVersion( ) );
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java
index 56b3bf0cf..84a1d0f81 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java
@@ -181,6 +181,10 @@ public class CleanupReleasedSnapshotsRepositoryPurge
{
log.error( "Could not remove metadata during cleanup of released snapshots of {}", path, e );
}
+ catch ( org.apache.archiva.repository.ContentAccessException e )
+ {
+ e.printStackTrace( );
+ }
}
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurge.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurge.java
index 1a443ee9a..f5ae868b8 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurge.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurge.java
@@ -115,7 +115,7 @@ public class DaysOldRepositoryPurge
{
if ( newArtifactFile.getModificationTime().toEpochMilli() < olderThanThisDate.getTimeInMillis( ) )
{
- artifactsToDelete.addAll( repository.getRelatedArtifacts( newArtifactReference ) );
+ artifactsToDelete.addAll( repository.getRelatedArtifacts( repository.toVersion(newArtifactReference) ) );
}
}
// Is this a timestamp snapshot "1.0-20070822.123456-42" ?
@@ -125,7 +125,7 @@ public class DaysOldRepositoryPurge
if ( timestampCal.getTimeInMillis( ) < olderThanThisDate.getTimeInMillis( ) )
{
- artifactsToDelete.addAll( repository.getRelatedArtifacts( newArtifactReference ) );
+ artifactsToDelete.addAll( repository.getRelatedArtifacts( repository.toVersion(newArtifactReference) ) );
}
}
}
@@ -139,6 +139,10 @@ public class DaysOldRepositoryPurge
{
log.debug( "Not processing file that is not an artifact: {}", e.getMessage( ) );
}
+ catch ( org.apache.archiva.repository.ContentAccessException e )
+ {
+ e.printStackTrace( );
+ }
}
private Calendar uniqueSnapshotToCalendar( String version )
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java
index 5cd523d93..af617c143 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java
@@ -94,7 +94,8 @@ public class RetentionCountRepositoryPurge
{
break;
}
- artifactsToDelete.addAll( repository.getRelatedArtifacts( getNewArtifactReference( artifact, version ) ) );
+ VersionedReference ref = repository.toVersion( getNewArtifactReference( artifact, version ) );
+ artifactsToDelete.addAll( repository.getRelatedArtifacts( ref ) );
}
purge( artifactsToDelete );
}
@@ -107,6 +108,10 @@ public class RetentionCountRepositoryPurge
{
log.error( "Repostory artifact not found {}", path );
}
+ catch ( org.apache.archiva.repository.ContentAccessException e )
+ {
+ e.printStackTrace( );
+ }
}
/*