if ( !artifactFile.exists() )
{
return;
}
ArtifactReference artifact = repository.toArtifactReference( path );
Calendar olderThanThisDate = Calendar.getInstance( DateUtils.UTC_TIME_ZONE );
olderThanThisDate.add( Calendar.DATE, -daysOlder );
// Is this a generic snapshot "1.0-SNAPSHOT" ?
if ( VersionUtil.isGenericSnapshot( artifact.getVersion() ) )
{
if ( artifactFile.lastModified() < olderThanThisDate.getTimeInMillis() )
{
doPurgeAllRelated( artifactFile );
}
}
// Is this a timestamp snapshot "1.0-20070822.123456-42" ?
else if ( VersionUtil.isUniqueSnapshot( artifact.getVersion() ) )
{
Calendar timestampCal = uniqueSnapshotToCalendar( artifact.getVersion() );
if ( timestampCal.getTimeInMillis() < olderThanThisDate.getTimeInMillis() )
{
doPurgeAllRelated( artifactFile );
}