From 4ea422a9d19e45394f442df2b6468d7aa5be8482 Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Tue, 8 Dec 2009 22:31:37 +0000 Subject: [PATCH] remove unnecessary dependency on commons-lang git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-1025@888603 13f79535-47bb-0310-9956-ffa450edef68 --- .../rss/processor/NewArtifactsRssFeedProcessor.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessor.java b/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessor.java index 9f1525a4e..addf50dec 100644 --- a/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessor.java +++ b/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessor.java @@ -22,10 +22,11 @@ package org.apache.archiva.rss.processor; import java.util.Calendar; import java.util.List; import java.util.Map; +import java.util.TimeZone; +import com.sun.syndication.feed.synd.SyndFeed; import org.apache.archiva.rss.RssFeedEntry; import org.apache.archiva.rss.RssFeedGenerator; -import org.apache.commons.lang.time.DateUtils; import org.apache.maven.archiva.database.ArchivaDatabaseException; import org.apache.maven.archiva.database.ArtifactDAO; import org.apache.maven.archiva.database.Constraint; @@ -34,8 +35,6 @@ import org.apache.maven.archiva.model.ArchivaArtifact; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.sun.syndication.feed.synd.SyndFeed; - /** * Retrieve and process all artifacts of a repository from the database and generate a rss feed. * The artifacts will be grouped by the date when the artifacts were gathered. @@ -65,6 +64,8 @@ public class NewArtifactsRssFeedProcessor */ private ArtifactDAO artifactDAO; + private static final TimeZone GMT_TIME_ZONE = TimeZone.getTimeZone( "GMT" ); + /** * Process the newly discovered artifacts in the repository. Generate feeds for new artifacts in the repository and * new versions of artifact. @@ -85,7 +86,7 @@ public class NewArtifactsRssFeedProcessor private SyndFeed processNewArtifactsInRepo( String repoId ) throws ArchivaDatabaseException { - Calendar greaterThanThisDate = Calendar.getInstance( DateUtils.UTC_TIME_ZONE ); + Calendar greaterThanThisDate = Calendar.getInstance( GMT_TIME_ZONE ); greaterThanThisDate.add( Calendar.DATE, -( getNumberOfDaysBeforeNow() ) ); Constraint artifactsByRepo = new ArtifactsByRepositoryConstraint( repoId, greaterThanThisDate.getTime(), "whenGathered", false ); -- 2.39.5