From: Olivier Lamy Date: Mon, 1 Sep 2014 04:04:41 +0000 (+1000) Subject: [MRM-1854] Last modified date is epoch on directory listing for a group X-Git-Tag: archiva-2.1.1~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d4c85abfac8d0920549f20735caf0e4028149c5c;p=archiva.git [MRM-1854] Last modified date is epoch on directory listing for a group --- 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 9d4b8ce92..375c4d83d 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 @@ -244,7 +244,7 @@ public class ArchivaDavResourceFactory getResourceFromGroup( request, repoGroupConfig.getRepositories(), archivaLocator, repoGroupConfig ); - setHeaders( response, locator, davResource ); + setHeaders( response, locator, davResource, true ); return davResource; @@ -291,7 +291,7 @@ public class ArchivaDavResourceFactory auditListeners, // scheduler, // fileLockManager ); - setHeaders( response, locator, resource ); + setHeaders( response, locator, resource, false ); return resource; } } @@ -432,7 +432,7 @@ public class ArchivaDavResourceFactory } } - setHeaders( response, locator, resource ); + setHeaders( response, locator, resource, false ); // compatibility with MRM-440 to ensure browsing the repository works ok if ( resource.isCollection() && !request.getRequestURI().endsWith( "/" ) ) @@ -873,7 +873,8 @@ public class ArchivaDavResourceFactory this.auditListeners.remove( listener ); } - private void setHeaders( DavServletResponse response, DavResourceLocator locator, DavResource resource ) + private void setHeaders( DavServletResponse response, DavResourceLocator locator, DavResource resource, + boolean group ) { // [MRM-503] - Metadata file need Pragma:no-cache response // header. @@ -894,6 +895,14 @@ public class ArchivaDavResourceFactory response.setHeader( "Cache-Control", "no-cache" ); response.setDateHeader( "Last-Modified", new Date().getTime() ); } + else if ( group ) + { + if ( resource instanceof ArchivaVirtualDavResource ) + { + //MRM-1854 here we have a directory so force "Last-Modified" + response.setDateHeader( "Last-Modified", new Date().getTime() ); + } + } else { // We need to specify this so connecting wagons can work correctly