summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-web
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-09-26 12:56:58 +0000
committerOlivier Lamy <olamy@apache.org>2012-09-26 12:56:58 +0000
commit5f9755b5ae526a83ecdd219401c97498b223b776 (patch)
tree7f4a55403d18d247d8404bdb2edd09288bcf06a8 /archiva-modules/archiva-web
parentb5239a7456801d2439437598cda9870859850a6a (diff)
downloadarchiva-5f9755b5ae526a83ecdd219401c97498b223b776.tar.gz
archiva-5f9755b5ae526a83ecdd219401c97498b223b776.zip
simplify code and fix case typo on http header
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1390449 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web')
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java20
1 files changed, 8 insertions, 12 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 c8fe1b87b..30f387f0f 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
@@ -112,7 +112,7 @@ import java.util.Set;
/**
*
*/
-@Service ("davResourceFactory#archiva")
+@Service ( "davResourceFactory#archiva" )
public class ArchivaDavResourceFactory
implements DavResourceFactory, Auditable
{
@@ -145,7 +145,7 @@ public class ArchivaDavResourceFactory
*
*/
@Inject
- @Named (value = "repositoryProxyConnectors#default")
+ @Named ( value = "repositoryProxyConnectors#default" )
private RepositoryProxyConnectors connectors;
/**
@@ -175,7 +175,7 @@ public class ArchivaDavResourceFactory
*
*/
@Inject
- @Named (value = "httpAuthenticator#basic")
+ @Named ( value = "httpAuthenticator#basic" )
private HttpAuthenticator httpAuth;
@Inject
@@ -208,7 +208,7 @@ public class ArchivaDavResourceFactory
*
*/
@Inject
- @Named (value = "archivaTaskScheduler#repository")
+ @Named ( value = "archivaTaskScheduler#repository" )
private RepositoryArchivaTaskScheduler scheduler;
private ApplicationContext applicationContext;
@@ -847,23 +847,19 @@ public class ArchivaDavResourceFactory
{
// [MRM-503] - Metadata file need Pragma:no-cache response
// header.
- if ( locator.getResourcePath().endsWith( "/maven-metadata.xml" ) )
+ if ( locator.getResourcePath().endsWith( "/maven-metadata.xml" )
+ || ( (ArchivaDavResource) resource ).getLocalResource().isDirectory() )
{
response.setHeader( "Pragma", "no-cache" );
response.setHeader( "Cache-Control", "no-cache" );
+ response.setDateHeader( "Last-Modified", new Date().getTime() );
}
// if the resource is a directory don't cache it as new groupId deployed will be available
// without need of refreshing browser
- if ( ( (ArchivaDavResource) resource ).getLocalResource().isDirectory() )
- {
- response.setHeader( "Pragma", "no-cache" );
- 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() );
+ response.setDateHeader( "Last-Modified", resource.getModificationTime() );
}
// TODO: [MRM-524] determine http caching options for other types of files (artifacts, sha1, md5, snapshots)
}