diff options
author | Olivier Lamy <olamy@apache.org> | 2014-09-01 14:04:41 +1000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2014-09-01 14:04:41 +1000 |
commit | d4c85abfac8d0920549f20735caf0e4028149c5c (patch) | |
tree | f77d6ebdd7809a579e3fa08a61b0898a8405d60c /archiva-modules | |
parent | d42a81ac34905fb62c3f121138a1cf246002a52b (diff) | |
download | archiva-d4c85abfac8d0920549f20735caf0e4028149c5c.tar.gz archiva-d4c85abfac8d0920549f20735caf0e4028149c5c.zip |
[MRM-1854] Last modified date is epoch on directory listing for a group
Diffstat (limited to 'archiva-modules')
-rw-r--r-- | archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java | 17 |
1 files changed, 13 insertions, 4 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 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 |