From 17eb20fb63415c86d9681badcbb52b8f6c46000a Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Sun, 16 Feb 2014 21:58:26 +0000 Subject: [PATCH] fix unit test due to bad previous commit git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1568841 13f79535-47bb-0310-9956-ffa450edef68 --- .../webdav/ArchivaDavResourceFactory.java | 19 +++++++++++-------- .../webdav/RepositoryServletNoProxyTest.java | 2 +- pom.xml | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java index 909130fa8..80e93b91d 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java @@ -107,7 +107,6 @@ import javax.servlet.http.HttpSession; import java.io.File; import java.io.IOException; import java.util.ArrayList; -import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.HashSet; @@ -416,8 +415,8 @@ public class ArchivaDavResourceFactory catch ( DigesterException de ) { throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, - "Error occurred while generating checksum files." + de.getMessage() - ); + "Error occurred while generating checksum files." + + de.getMessage() ); } } } @@ -877,6 +876,11 @@ public class ArchivaDavResourceFactory response.setHeader( "Cache-Control", "no-cache" ); response.setDateHeader( "Last-Modified", new Date().getTime() ); } + else + { + // We need to specify this so connecting wagons can work correctly + response.setDateHeader( "Last-Modified", resource.getModificationTime() ); + } // TODO: [MRM-524] determine http caching options for other types of files (artifacts, sha1, md5, snapshots) } @@ -988,12 +992,11 @@ public class ArchivaDavResourceFactory || repositoryGroupConfiguration.getRepositories().isEmpty() ) { File file = - new File( System.getProperty( "appserver.base"), "groups/" + repositoryGroupConfiguration.getId() ); + new File( System.getProperty( "appserver.base" ), "groups/" + repositoryGroupConfiguration.getId() ); - return new ArchivaDavResource( file.getPath(), "groups/" + repositoryGroupConfiguration.getId(), - null,request.getDavSession(), locator, this, - mimeTypes, auditListeners, - scheduler, fileLockManager ); + return new ArchivaDavResource( file.getPath(), "groups/" + repositoryGroupConfiguration.getId(), null, + request.getDavSession(), locator, this, mimeTypes, auditListeners, scheduler, + fileLockManager ); } List mergedRepositoryContents = new ArrayList(); // multiple repo types so we guess they are all the same type diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletNoProxyTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletNoProxyTest.java index d5710a5d0..121b4e170 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletNoProxyTest.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletNoProxyTest.java @@ -62,7 +62,7 @@ public class RepositoryServletNoProxyTest //WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + commonsLangSha1 ); WebResponse response = getWebResponse( "/repository/internal/" + commonsLangSha1 ); - assertNotNull( response.getResponseHeaderValue( "last-modified" ) ); + assertNotNull( response.getResponseHeaderValue( "Last-Modified" ) ); } @Test diff --git a/pom.xml b/pom.xml index a4d64387e..2b707ce50 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ 2.1 2.1 1.7.5 - 2.0-beta9 + 2.0-rc1 4.0.1.RELEASE -- 2.39.5