You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by jd...@apache.org on 2009/02/12 15:03:02 UTC

svn commit: r743746 - in /archiva/branches/archiva-with-new-repoapi/archiva-modules: archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ archiva-base/archiva-proxy/ archiva-base/archiva-p...

Author: jdumay
Date: Thu Feb 12 14:03:01 2009
New Revision: 743746

URL: http://svn.apache.org/viewvc?rev=743746&view=rev
Log:
* Working ProxyRepositoryManager that wrapps RepositoryProxyConnectors
* Removed archiva-webdav from the war (keeping it around so we can raid the servlet tests)
* Half backed GroupRepositoryManager
* Consumers after proxy have been disabled - we should fire this off to a eventbus that can run the consumers on a executor service


Added:
    archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/MutableResourceContext.java
    archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyRepositoryManager.java
    archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/java/org/apache/archiva/repository/GroupRepositoryManager.java
Modified:
    archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ArtifactUpdateDatabaseConsumer.java
    archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/pom.xml
    archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java
    archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/RepositoryProxyConnectors.java
    archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/resources/META-INF/spring-context.xml
    archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/api/MimeTypes.java
    archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/api/Status.java
    archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/java/org/apache/archiva/repository/DefaultRepositoryFactory.java
    archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/java/org/apache/archiva/repository/DefaultRepositoryInterceptorFactory.java
    archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/java/org/apache/archiva/repository/DefaultRepositoryManagerFactory.java
    archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/resources/META-INF/spring-context.xml
    archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-web/archiva-repository-servlet/src/main/java/org/apache/archiva/web/servlet/HttpRepositoryContext.java
    archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-web/archiva-repository-servlet/src/main/java/org/apache/archiva/web/servlet/RepositoryServlet.java
    archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-web/archiva-webapp/pom.xml
    archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java

Modified: archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ArtifactUpdateDatabaseConsumer.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ArtifactUpdateDatabaseConsumer.java?rev=743746&r1=743745&r2=743746&view=diff
==============================================================================
--- archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ArtifactUpdateDatabaseConsumer.java (original)
+++ archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ArtifactUpdateDatabaseConsumer.java Thu Feb 12 14:03:01 2009
@@ -162,8 +162,8 @@
             return;
         }
 
-        try
-        {
+//        try
+//        {
             artifact.getModel().setRepositoryId( this.repository.getId() );
 
             // Calculate the hashcodes.
@@ -199,12 +199,12 @@
                 artifact.getModel().setWhenGathered( whenGathered );
             }
 
-            dao.getArtifactDAO().saveArtifact( artifact );
-        }
-        catch ( ArchivaDatabaseException e )
-        {
-            triggerConsumerError( DB_ERROR, "Unable to save artifact to database: " + e.getMessage() );
-        }
+            //dao.getArtifactDAO().saveArtifact( artifact );
+//        }
+//        catch ( ArchivaDatabaseException e )
+//        {
+//            triggerConsumerError( DB_ERROR, "Unable to save artifact to database: " + e.getMessage() );
+//        }
     }
 
     /**

Modified: archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/pom.xml
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/pom.xml?rev=743746&r1=743745&r2=743746&view=diff
==============================================================================
--- archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/pom.xml (original)
+++ archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/pom.xml Thu Feb 12 14:03:01 2009
@@ -39,6 +39,10 @@
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-repository-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-repository-layer</artifactId>
     </dependency>
     <dependency>
@@ -63,6 +67,10 @@
       <artifactId>plexus-component-api</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-model</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.codehaus.plexus.registry</groupId>
       <artifactId>plexus-registry-commons</artifactId>
       <scope>test</scope>
@@ -81,7 +89,6 @@
     <dependency>
       <groupId>org.apache.maven.wagon</groupId>
       <artifactId>wagon-http-lightweight</artifactId>
-      <version>${wagon.version}</version>
       <scope>test</scope>
     </dependency>
   </dependencies>

Modified: archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java?rev=743746&r1=743745&r2=743746&view=diff
==============================================================================
--- archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java (original)
+++ archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java Thu Feb 12 14:03:01 2009
@@ -119,9 +119,9 @@
      */
     private UrlFailureCache urlFailureCache;
 
-    private Map<String, List<ProxyConnector>> proxyConnectorMap = new HashMap<String, List<ProxyConnector>>();
+    private final Map<String, List<ProxyConnector>> proxyConnectorMap = new HashMap<String, List<ProxyConnector>>();
 
-    private Map<String, ProxyInfo> networkProxyMap = new HashMap<String, ProxyInfo>();
+    private final Map<String, ProxyInfo> networkProxyMap = new HashMap<String, ProxyInfo>();
 
     /**
      * @plexus.requirement
@@ -146,7 +146,7 @@
             requestProperties.setProperty( "version", artifact.getVersion() );
             requestProperties.setProperty( "managedRepositoryId", repository.getId() );
 
-            List<ProxyConnector> connectors = getProxyConnectors( repository );
+            List<ProxyConnector> connectors = getProxyConnectors( repository.getId() );
             Map<String, Exception> previousExceptions = new LinkedHashMap<String, Exception>();
             for ( ProxyConnector connector : connectors )
             {
@@ -222,7 +222,7 @@
             requestProperties.setProperty( "filetype", "resource" );
             requestProperties.setProperty( "managedRepositoryId", repository.getId() );
 
-            List<ProxyConnector> connectors = getProxyConnectors( repository );
+            List<ProxyConnector> connectors = getProxyConnectors( repository.getId() );
             for ( ProxyConnector connector : connectors )
             {
                 if (connector.isDisabled())
@@ -286,7 +286,7 @@
             boolean metadataNeedsUpdating = false;
             long originalTimestamp = getLastModified( localFile );
 
-            List<ProxyConnector> connectors = getProxyConnectors( repository );
+            List<ProxyConnector> connectors = getProxyConnectors( repository.getId() );
             for ( ProxyConnector connector : connectors )
             {
                 if (connector.isDisabled())
@@ -390,11 +390,11 @@
     /**
      * Test if the provided ManagedRepositoryContent has any proxies configured for it.
      */
-    public boolean hasProxies( ManagedRepositoryContent repository )
+    public boolean hasProxies( String repositoryId )
     {
         synchronized ( this.proxyConnectorMap )
         {
-            return this.proxyConnectorMap.containsKey( repository.getId() );
+            return this.proxyConnectorMap.containsKey( repositoryId );
         }
     }
 
@@ -458,6 +458,12 @@
         url = url + remotePath;
         requestProperties.setProperty( "url", url );
 
+        //Whilelist patterns dont work if the first char is a slash
+        if (remotePath.startsWith("/"))
+        {
+            remotePath = remotePath.substring(1);
+        }
+
         // Is a whitelist defined?
         if ( CollectionUtils.isNotEmpty( connector.getWhitelist() ) )
         {
@@ -610,11 +616,11 @@
             }
         }
 
-        if ( executeConsumers )
-        {
-            // Just-in-time update of the index and database by executing the consumers for this artifact
-            consumers.executeConsumers( connector.getSourceRepository().getRepository(), resource );
-        }
+//        if ( executeConsumers )
+//        {
+//            // Just-in-time update of the index and database by executing the consumers for this artifact
+//            consumers.executeConsumers( connector.getSourceRepository().getRepository(), resource );
+//        }
         
         return resource;
     }
@@ -714,7 +720,7 @@
         {
             temp = new File(workingDirectory, localFile.getName());
 
-            boolean success = false;
+        boolean success = false;
 
             if ( !localFile.exists() )
             {
@@ -1017,11 +1023,11 @@
     /**
      * TODO: Ensure that list is correctly ordered based on configuration. See MRM-477
      */
-    public List<ProxyConnector> getProxyConnectors( ManagedRepositoryContent repository )
+    public List<ProxyConnector> getProxyConnectors( String repositoryId )
     {
         synchronized ( this.proxyConnectorMap )
         {
-            List<ProxyConnector> ret = (List<ProxyConnector>) this.proxyConnectorMap.get( repository.getId() );
+            final List<ProxyConnector> ret = (List<ProxyConnector>) this.proxyConnectorMap.get( repositoryId );
             if ( ret == null )
             {
                 return Collections.emptyList();

Added: archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/MutableResourceContext.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/MutableResourceContext.java?rev=743746&view=auto
==============================================================================
--- archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/MutableResourceContext.java (added)
+++ archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/MutableResourceContext.java Thu Feb 12 14:03:01 2009
@@ -0,0 +1,62 @@
+/*
+ *  Copyright 2009 jdumay.
+ * 
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ * 
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *  under the License.
+ */
+
+package org.apache.maven.archiva.proxy;
+
+import org.apache.archiva.repository.api.ResourceContext;
+
+public class MutableResourceContext implements ResourceContext
+{
+    private final ResourceContext context;
+
+    private String logicalPath;
+
+    private String repositoryId;
+
+    public MutableResourceContext(ResourceContext context)
+    {
+        this.context = context;
+    }
+
+    public String getLogicalPath()
+    {
+        if (logicalPath != null)
+        {
+            return logicalPath;
+        }
+        return context.getLogicalPath();
+    }
+
+    public String getRepositoryId()
+    {
+        if (repositoryId != null)
+        {
+            return repositoryId;
+        }
+        return repositoryId;
+    }
+
+    public void setLogicalPath(String logicalPath)
+    {
+        this.logicalPath = logicalPath;
+    }
+
+    public void setRepositoryId(String repositoryId)
+    {
+        this.repositoryId = repositoryId;
+    }
+}

Added: archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyRepositoryManager.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyRepositoryManager.java?rev=743746&view=auto
==============================================================================
--- archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyRepositoryManager.java (added)
+++ archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyRepositoryManager.java Thu Feb 12 14:03:01 2009
@@ -0,0 +1,327 @@
+package org.apache.maven.archiva.proxy;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import org.apache.archiva.repository.api.RepositoryManager;
+import org.apache.archiva.repository.api.RepositoryManagerException;
+import org.apache.archiva.repository.api.RepositoryManagerWeight;
+import org.apache.archiva.repository.api.ResourceContext;
+import org.apache.archiva.repository.api.Status;
+import org.apache.archiva.repository.api.SystemRepositoryManager;
+import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.maven.archiva.policies.ProxyDownloadException;
+import org.apache.maven.archiva.repository.ManagedRepositoryContent;
+import org.apache.maven.archiva.repository.RepositoryContentFactory;
+import org.apache.maven.archiva.repository.RepositoryException;
+import org.apache.maven.archiva.repository.RepositoryNotFoundException;
+import org.apache.maven.archiva.repository.content.RepositoryRequest;
+import org.apache.maven.archiva.repository.layout.LayoutException;
+import org.apache.maven.model.DistributionManagement;
+import org.apache.maven.model.Relocation;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.apache.maven.model.Model;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@RepositoryManagerWeight(500)
+public class ProxyRepositoryManager implements RepositoryManager
+{
+    private static final Logger log = LoggerFactory.getLogger(ProxyRepositoryManager.class);
+
+    private final SystemRepositoryManager repositoryManager;
+
+    private final RepositoryProxyConnectors repositoryProxyConnectors;
+
+    private final RepositoryContentFactory repositoryFactory;
+
+    private final RepositoryRequest repositoryRequest;
+
+    public ProxyRepositoryManager(SystemRepositoryManager repositoryManager, RepositoryProxyConnectors repositoryProxyConnectors, RepositoryContentFactory repositoryFactory, RepositoryRequest repositoryRequest)
+    {
+        this.repositoryManager = repositoryManager;
+        this.repositoryProxyConnectors = repositoryProxyConnectors;
+        this.repositoryFactory = repositoryFactory;
+        this.repositoryRequest = repositoryRequest;
+    }
+
+    public boolean exists(String repositoryId)
+    {
+        return repositoryManager.exists(repositoryId);
+    }
+
+    public ResourceContext handles(ResourceContext context)
+    {
+        final List<ProxyConnector> connectors = repositoryProxyConnectors.getProxyConnectors(context.getRepositoryId());
+        if (connectors != null && connectors.size() > 0)
+        {
+            return context;
+        }
+        return null;
+    }
+
+    public boolean read(ResourceContext context, OutputStream os)
+    {
+        return repositoryManager.read(context, os);
+    }
+
+    public List<Status> stat(ResourceContext context)
+    {
+        //Return the stat() result from the system repository if we are simply getting a collection
+
+        ManagedRepositoryContent managedRepository = null;
+        try
+        {
+            managedRepository = repositoryFactory.getManagedRepositoryContent(context.getRepositoryId());
+        }
+        catch (RepositoryNotFoundException e)
+        {
+            throw new RepositoryManagerException(e.getMessage(), e);
+        }
+        catch (RepositoryException e)
+        {
+            throw new RepositoryManagerException(e.getMessage(), e);
+        }
+
+        //Check if logical path can be mushed into a valid path. This is so ugly.
+        boolean isCollection = false;
+        try
+        {
+            this.repositoryRequest.toArtifactReference(context.getLogicalPath());
+        }
+        catch (LayoutException e)
+        {
+            try
+            {
+                repositoryRequest.toNativePath(context.getLogicalPath(), managedRepository);
+            }
+            catch (LayoutException ex)
+            {
+                isCollection = true;
+            }
+        }
+
+        if (isCollection)
+        {
+            return repositoryManager.stat(context);
+        }
+
+        final Status status = doProxy(managedRepository, context);
+        if (status != null)
+        {
+            return Arrays.asList(status);
+        }
+        return Collections.EMPTY_LIST;
+    }
+
+    public boolean write(ResourceContext context, InputStream is)
+    {
+        return repositoryManager.write(context, is);
+    }
+
+    private Status doProxy( ManagedRepositoryContent managedRepository, ResourceContext context )
+        throws RepositoryManagerException
+    {
+        File resourceFile = new File( managedRepository.getRepoRoot(), context.getLogicalPath() );
+        
+        // At this point the incoming request can either be in default or
+        // legacy layout format.
+        Status status = fetchContentFromProxies( managedRepository, context );
+
+        try
+        {
+            // Perform an adjustment of the resource to the managed
+            // repository expected path.
+            String localResourcePath = repositoryRequest.toNativePath( context.getLogicalPath(), managedRepository );
+            resourceFile = new File( managedRepository.getId(), localResourcePath );
+        }
+        catch ( LayoutException e )
+        {
+            return Status.fromFile(resourceFile);
+        }
+
+        // Attempt to fetch the resource from any defined proxy.
+        if ( status != null )
+        {
+            String repositoryId = context.getRepositoryId();
+//            String event = ( previouslyExisted ? AuditEvent.MODIFY_FILE : AuditEvent.CREATE_FILE ) + PROXIED_SUFFIX;
+//            triggerAuditEvent( request.getRemoteAddr(), repositoryId, logicalResource.getPath(), event );
+        }
+
+        return status;
+    }
+
+    private Status fetchContentFromProxies( ManagedRepositoryContent managedRepository, ResourceContext context )
+        throws RepositoryManagerException
+    {
+        if ( repositoryRequest.isSupportFile( context.getLogicalPath() ) )
+        {
+            File proxiedFile = repositoryProxyConnectors.fetchFromProxies( managedRepository, context.getLogicalPath() );
+            if (proxiedFile != null)
+            {
+                return Status.fromFile(proxiedFile);
+            }
+        }
+
+        // Is it a Metadata resource?
+        if ( repositoryRequest.isDefault( context.getLogicalPath() ) && repositoryRequest.isMetadata( context.getLogicalPath() ) )
+        {
+            final File result = repositoryProxyConnectors.fetchMetatadaFromProxies(managedRepository, context.getLogicalPath());
+            if (result != null)
+            {
+                return Status.fromFile(result);
+            }
+            return null;
+        }
+
+        // Not any of the above? Then it's gotta be an artifact reference.
+        try
+        {
+            // Get the artifact reference in a layout neutral way.
+            ArtifactReference artifact = repositoryRequest.toArtifactReference( context.getLogicalPath() );
+
+            if ( artifact != null )
+            {
+                applyServerSideRelocation( managedRepository, artifact );
+
+                File proxiedFile = repositoryProxyConnectors.fetchFromProxies( managedRepository, artifact );
+
+                MutableResourceContext resourceContext = new MutableResourceContext(context);
+                resourceContext.setLogicalPath(managedRepository.toPath( artifact ));
+
+                if (proxiedFile != null)
+                {
+                    return Status.fromFile(proxiedFile);
+                }
+            }
+        }
+        catch ( LayoutException e )
+        {
+            /* eat it */
+        }
+        catch ( ProxyDownloadException e )
+        {
+            throw new RepositoryManagerException(e.getMessage(), e);
+        }
+
+        File resourceFile = new File(managedRepository.getRepoRoot(), context.getLogicalPath());
+        if (resourceFile.exists())
+        {
+            return Status.fromFile(resourceFile);
+        }
+        return null;
+    }
+
+    /**
+     * A relocation capable client will request the POM prior to the artifact, and will then read meta-data and do
+     * client side relocation. A simplier client (like maven 1) will only request the artifact and not use the
+     * metadatas.
+     * <p>
+     * For such clients, archiva does server-side relocation by reading itself the &lt;relocation&gt; element in
+     * metadatas and serving the expected artifact.
+     */
+    protected void applyServerSideRelocation( ManagedRepositoryContent managedRepository, ArtifactReference artifact )
+        throws ProxyDownloadException
+    {
+        if ( "pom".equals( artifact.getType() ) )
+        {
+            return;
+        }
+
+        // Build the artifact POM reference
+        ArtifactReference pomReference = new ArtifactReference();
+        pomReference.setGroupId( artifact.getGroupId() );
+        pomReference.setArtifactId( artifact.getArtifactId() );
+        pomReference.setVersion( artifact.getVersion() );
+        pomReference.setType( "pom" );
+
+        // Get the artifact POM from proxied repositories if needed
+        repositoryProxyConnectors.fetchFromProxies( managedRepository, pomReference );
+
+        // Open and read the POM from the managed repo
+        File pom = managedRepository.toFile( pomReference );
+
+        if ( !pom.exists() )
+        {
+            return;
+        }
+
+        try
+        {
+            // MavenXpp3Reader leaves the file open, so we need to close it ourselves.
+            FileReader reader = new FileReader( pom );
+            Model model = null;
+            try
+            {
+                model = new MavenXpp3Reader().read( reader );
+            }
+            finally
+            {
+                if (reader != null)
+                {
+                    reader.close();
+                }
+            }
+
+            final DistributionManagement dist = model.getDistributionManagement();
+            if ( dist != null )
+            {
+                final Relocation relocation = dist.getRelocation();
+                if ( relocation != null )
+                {
+                    // artifact is relocated : update the repositoryPath
+                    if ( relocation.getGroupId() != null )
+                    {
+                        artifact.setGroupId( relocation.getGroupId() );
+                    }
+                    if ( relocation.getArtifactId() != null )
+                    {
+                        artifact.setArtifactId( relocation.getArtifactId() );
+                    }
+                    if ( relocation.getVersion() != null )
+                    {
+                        artifact.setVersion( relocation.getVersion() );
+                    }
+                }
+            }
+        }
+        catch ( FileNotFoundException e )
+        {
+            // Artifact has no POM in repo : ignore
+        }
+        catch ( IOException e )
+        {
+            // Unable to read POM : ignore.
+        }
+        catch ( XmlPullParserException e )
+        {
+            // Invalid POM : ignore
+        }
+    }
+}

Modified: archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/RepositoryProxyConnectors.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/RepositoryProxyConnectors.java?rev=743746&r1=743745&r2=743746&view=diff
==============================================================================
--- archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/RepositoryProxyConnectors.java (original)
+++ archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/RepositoryProxyConnectors.java Thu Feb 12 14:03:01 2009
@@ -77,15 +77,15 @@
      * @param repository the source repository to look for.
      * @return the List of {@link ProxyConnector} objects.
      */
-    public List<ProxyConnector> getProxyConnectors( ManagedRepositoryContent repository );
+    public List<ProxyConnector> getProxyConnectors( String repositoryId );
 
     /**
      * Tests to see if the provided repository is a source repository for
      * any {@link ProxyConnector} objects.
      * 
-     * @param repository the source repository to look for.
+     * @param repositoryId the source repository to look for.
      * @return true if there are proxy connectors that use the provided 
      *   repository as a source repository.
      */
-    public boolean hasProxies( ManagedRepositoryContent repository );
+    public boolean hasProxies( String repositoryId );
 }

Modified: archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/resources/META-INF/spring-context.xml?rev=743746&r1=743745&r2=743746&view=diff
==============================================================================
--- archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/resources/META-INF/spring-context.xml (original)
+++ archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-proxy/src/main/resources/META-INF/spring-context.xml Thu Feb 12 14:03:01 2009
@@ -27,4 +27,11 @@
     <property name="serviceLocatorInterface"
       value="org.apache.maven.archiva.proxy.WagonFactory" />
   </bean>
+
+  <bean id="proxyRepositoryManager" class="org.apache.maven.archiva.proxy.ProxyRepositoryManager">
+      <constructor-arg ref="systemRepositoryManager"/>
+      <constructor-arg ref="repositoryProxyConnectors"/>
+      <constructor-arg ref="repositoryContentFactory"/>
+      <constructor-arg ref="repositoryRequest"/>
+  </bean>
 </beans>
\ No newline at end of file

Modified: archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/api/MimeTypes.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/api/MimeTypes.java?rev=743746&r1=743745&r2=743746&view=diff
==============================================================================
--- archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/api/MimeTypes.java (original)
+++ archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/api/MimeTypes.java Thu Feb 12 14:03:01 2009
@@ -35,19 +35,21 @@
 /**
  * MimeType sniffing for repository Artifacts
  */
-public class MimeTypes
+public final class MimeTypes
 {
     private static final Logger log = Logger.getLogger(MimeTypes.class);
 
     private static final String DEFAULT_MIME_TYPE = "application/octet-stream";
-
-    private String resource = "/mime.types";
     
-    private Map mimeMap = new HashMap();
+    private static final Map mimeMap = new HashMap();
+
+    private MimeTypes()
+    {
+    }
 
-    public MimeTypes()
+    static
     {
-        load(resource);
+        load("/mime.types");
     }
 
     /**
@@ -56,7 +58,7 @@
      * @param filename the filename to obtain the mime type for.
      * @return a mime type String, or null if filename is null, has no extension, or no mime type is associated with it.
      */
-    public String getMimeType( String filename )
+    public static String getMimeType( String filename )
     {
         String value = null;
         if ( !StringUtils.isEmpty( filename ) )
@@ -79,9 +81,9 @@
 
     }
 
-    private void load( String resourceName )
+    private static void load( String resourceName )
     {
-        ClassLoader cloader = this.getClass().getClassLoader();
+        ClassLoader cloader = MimeTypes.class.getClassLoader();
 
         /* Load up the mime types table */
         URL mimeURL = cloader.getResource( resourceName );
@@ -108,7 +110,7 @@
         }
     }
 
-    private void load( InputStream mimeStream )
+    private static void load( InputStream mimeStream )
     {
         mimeMap.clear();
 
@@ -144,7 +146,7 @@
                     while ( tokenizer.hasMoreTokens() )
                     {
                         String extension = tokenizer.nextToken().toLowerCase();
-                        this.mimeMap.put( extension, type );
+                        MimeTypes.mimeMap.put( extension, type );
                     }
                 }
             }

Modified: archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/api/Status.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/api/Status.java?rev=743746&r1=743745&r2=743746&view=diff
==============================================================================
--- archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/api/Status.java (original)
+++ archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/api/Status.java Thu Feb 12 14:03:01 2009
@@ -27,12 +27,6 @@
  */
 public final class Status
 {
-    private static final MimeTypes mimeTypes = new MimeTypes();
-
-    private Status()
-    {
-    }
-
     private ResourceType resourceType;
 
     private String contentType;
@@ -172,7 +166,7 @@
         }
         else
         {
-            status.setContentType(mimeTypes.getMimeType(file.getName()));
+            status.setContentType(MimeTypes.getMimeType(file.getName()));
             status.setContentLength(file.length());
             status.setResourceType(ResourceType.Resource);
         }

Modified: archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/java/org/apache/archiva/repository/DefaultRepositoryFactory.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/java/org/apache/archiva/repository/DefaultRepositoryFactory.java?rev=743746&r1=743745&r2=743746&view=diff
==============================================================================
--- archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/java/org/apache/archiva/repository/DefaultRepositoryFactory.java (original)
+++ archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/java/org/apache/archiva/repository/DefaultRepositoryFactory.java Thu Feb 12 14:03:01 2009
@@ -1,5 +1,24 @@
 package org.apache.archiva.repository;
 
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 import java.io.File;
 import java.util.HashMap;
 import java.util.Map;
@@ -20,9 +39,11 @@
     public Map<String, Repository> getRepositories()
     {
         final HashMap<String, Repository> repositories = new HashMap<String, Repository>();
-        for (ManagedRepositoryConfiguration configuration : archivaConfiguration.getConfiguration().getManagedRepositories())
+        for (final ManagedRepositoryConfiguration configuration : archivaConfiguration.getConfiguration().getManagedRepositories())
         {
-            repositories.put(configuration.getId(), new DefaultRepository(configuration.getId(), configuration.getName(), new File(configuration.getLocation())));
+            final DefaultRepository repository = new DefaultRepository(configuration.getId(), configuration.getName(), new File(configuration.getLocation()));
+            repositories.put(configuration.getId(), repository);
+            repository.getLocalPath().mkdirs();
         }
         return repositories;
     }

Modified: archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/java/org/apache/archiva/repository/DefaultRepositoryInterceptorFactory.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/java/org/apache/archiva/repository/DefaultRepositoryInterceptorFactory.java?rev=743746&r1=743745&r2=743746&view=diff
==============================================================================
--- archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/java/org/apache/archiva/repository/DefaultRepositoryInterceptorFactory.java (original)
+++ archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/java/org/apache/archiva/repository/DefaultRepositoryInterceptorFactory.java Thu Feb 12 14:03:01 2009
@@ -1,5 +1,24 @@
 package org.apache.archiva.repository;
 
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Map;
@@ -14,27 +33,26 @@
 {
     private ListableBeanFactory beanFactory;
 
-    private final ArrayList<RepositoryInterceptor> repositoryInterceptors;
+    private ArrayList<RepositoryInterceptor> repositoryInterceptors;
 
     private final Class interceptorType;
 
     public DefaultRepositoryInterceptorFactory(Class interceptorType)
     {
         this.interceptorType = interceptorType;
-        this.repositoryInterceptors = new ArrayList<RepositoryInterceptor>();
     }
 
-    public void init()
+    public Collection<RepositoryInterceptor> getRepositoryInterceptors()
     {
-        Map beans = beanFactory.getBeansOfType(interceptorType);
-        if (beans != null)
+        if (repositoryInterceptors == null)
         {
-            repositoryInterceptors.addAll(repositoryInterceptors);
+            repositoryInterceptors = new ArrayList<RepositoryInterceptor>();
+            Map beans = beanFactory.getBeansOfType(interceptorType);
+            if (beans != null)
+            {
+                repositoryInterceptors.addAll(repositoryInterceptors);
+            }
         }
-    }
-
-    public Collection<RepositoryInterceptor> getRepositoryInterceptors()
-    {
         return repositoryInterceptors;
     }
 

Modified: archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/java/org/apache/archiva/repository/DefaultRepositoryManagerFactory.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/java/org/apache/archiva/repository/DefaultRepositoryManagerFactory.java?rev=743746&r1=743745&r2=743746&view=diff
==============================================================================
--- archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/java/org/apache/archiva/repository/DefaultRepositoryManagerFactory.java (original)
+++ archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/java/org/apache/archiva/repository/DefaultRepositoryManagerFactory.java Thu Feb 12 14:03:01 2009
@@ -1,10 +1,31 @@
 package org.apache.archiva.repository;
 
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Map;
 import org.apache.archiva.repository.api.RepositoryManager;
 import org.apache.archiva.repository.api.RepositoryManagerFactory;
+import org.apache.archiva.repository.api.RepositoryWeightComparitor;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.BeanFactory;
 import org.springframework.beans.factory.BeanFactoryAware;
@@ -14,19 +35,20 @@
 {
     private ListableBeanFactory beanFactory;
 
-    private final ArrayList<RepositoryManager> repositoryManagers = new ArrayList<RepositoryManager>();
+    private ArrayList<RepositoryManager> repositoryManagers;
 
-    public void init()
+    public Collection<RepositoryManager> getRepositoryManagers()
     {
-        Map beans = beanFactory.getBeansOfType(RepositoryManager.class);
-        if (beans != null)
+        if (repositoryManagers == null)
         {
-            repositoryManagers.addAll(beans.values());
+            repositoryManagers = new ArrayList<RepositoryManager>();
+            Map beans = beanFactory.getBeansOfType(RepositoryManager.class);
+            if (beans != null)
+            {
+                repositoryManagers.addAll(beans.values());
+            }
+            Collections.sort(repositoryManagers, new RepositoryWeightComparitor());
         }
-    }
-
-    public Collection<RepositoryManager> getRepositoryManagers()
-    {
         return repositoryManagers;
     }
 

Added: archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/java/org/apache/archiva/repository/GroupRepositoryManager.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/java/org/apache/archiva/repository/GroupRepositoryManager.java?rev=743746&view=auto
==============================================================================
--- archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/java/org/apache/archiva/repository/GroupRepositoryManager.java (added)
+++ archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/java/org/apache/archiva/repository/GroupRepositoryManager.java Thu Feb 12 14:03:01 2009
@@ -0,0 +1,68 @@
+package org.apache.archiva.repository;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.List;
+import org.apache.archiva.repository.api.RepositoryManager;
+import org.apache.archiva.repository.api.RepositoryManagerWeight;
+import org.apache.archiva.repository.api.ResourceContext;
+import org.apache.archiva.repository.api.Status;
+import org.apache.archiva.repository.api.SystemRepositoryManager;
+
+@RepositoryManagerWeight(400)
+public class GroupRepositoryManager implements RepositoryManager
+{
+    private final RepositoryManager proxyRepositoryManager;
+
+    private final SystemRepositoryManager repositoryManager;
+
+    public GroupRepositoryManager(RepositoryManager proxyRepositoryManager, SystemRepositoryManager repositoryManager)
+    {
+        this.proxyRepositoryManager = proxyRepositoryManager;
+        this.repositoryManager = repositoryManager;
+    }
+
+    public boolean exists(String repositoryId)
+    {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    public ResourceContext handles(ResourceContext context)
+    {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    public boolean read(ResourceContext context, OutputStream os)
+    {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    public List<Status> stat(ResourceContext context)
+    {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    public boolean write(ResourceContext context, InputStream is)
+    {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+}

Modified: archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/resources/META-INF/spring-context.xml?rev=743746&r1=743745&r2=743746&view=diff
==============================================================================
--- archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/resources/META-INF/spring-context.xml (original)
+++ archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-base/archiva-repository/src/main/resources/META-INF/spring-context.xml Thu Feb 12 14:03:01 2009
@@ -6,12 +6,14 @@
        <bean name="repositoryFactory" class="org.apache.archiva.repository.DefaultRepositoryFactory">
            <constructor-arg ref="archivaConfiguration"/>
        </bean>
-       <bean name="systemRepositoryManager" class="org.apache.archiva.repository.DefaultRepositoryManager"/>
-       <bean name="repositoryManagerFactory" class="org.apache.archiva.repository.DefaultRepositoryManagerFactory" init-method="init"/>
-       <bean name="preRepositoryInterceptorFactory" class="org.apache.archiva.repository.DefaultRepositoryInterceptorFactory" init-method="init">
+       <bean name="systemRepositoryManager" class="org.apache.archiva.repository.DefaultRepositoryManager">
+           <constructor-arg ref="repositoryFactory"/>
+       </bean>
+       <bean name="repositoryManagerFactory" class="org.apache.archiva.repository.DefaultRepositoryManagerFactory"/>
+       <bean name="preRepositoryInterceptorFactory" class="org.apache.archiva.repository.DefaultRepositoryInterceptorFactory">
            <constructor-arg value="org.apache.archiva.repository.api.interceptor.PreRepositoryInterceptor"/>
        </bean>
-       <bean name="postRepositoryInterceptorFactory" class="org.apache.archiva.repository.DefaultRepositoryInterceptorFactory" init-method="init">
+       <bean name="postRepositoryInterceptorFactory" class="org.apache.archiva.repository.DefaultRepositoryInterceptorFactory">
            <constructor-arg value="org.apache.archiva.repository.api.interceptor.PostRepositoryInterceptor"/>
        </bean>
 </beans>
\ No newline at end of file

Modified: archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-web/archiva-repository-servlet/src/main/java/org/apache/archiva/web/servlet/HttpRepositoryContext.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-web/archiva-repository-servlet/src/main/java/org/apache/archiva/web/servlet/HttpRepositoryContext.java?rev=743746&r1=743745&r2=743746&view=diff
==============================================================================
--- archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-web/archiva-repository-servlet/src/main/java/org/apache/archiva/web/servlet/HttpRepositoryContext.java (original)
+++ archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-web/archiva-repository-servlet/src/main/java/org/apache/archiva/web/servlet/HttpRepositoryContext.java Thu Feb 12 14:03:01 2009
@@ -20,20 +20,18 @@
  */
 
 import org.apache.archiva.repository.api.PathUtils;
-import org.apache.archiva.repository.api.MimeTypes;
 import org.apache.archiva.repository.api.RepositoryContext;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import org.apache.archiva.repository.api.MimeTypes;
 import org.apache.archiva.repository.api.RequestType;
 import org.apache.commons.codec.binary.Base64;
 
 public class HttpRepositoryContext implements RepositoryContext
 {
-    private static final MimeTypes mimeTypes = new MimeTypes();
-
     private HttpServletRequest request;
     private HttpServletResponse response;
 
@@ -156,6 +154,6 @@
 
     public String getContentType()
     {
-        return mimeTypes.getMimeType(logicalPath);
+        return MimeTypes.getMimeType(logicalPath);
     }
 }

Modified: archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-web/archiva-repository-servlet/src/main/java/org/apache/archiva/web/servlet/RepositoryServlet.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-web/archiva-repository-servlet/src/main/java/org/apache/archiva/web/servlet/RepositoryServlet.java?rev=743746&r1=743745&r2=743746&view=diff
==============================================================================
--- archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-web/archiva-repository-servlet/src/main/java/org/apache/archiva/web/servlet/RepositoryServlet.java (original)
+++ archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-web/archiva-repository-servlet/src/main/java/org/apache/archiva/web/servlet/RepositoryServlet.java Thu Feb 12 14:03:01 2009
@@ -194,7 +194,7 @@
         }
         else
         {
-            resp.sendError(HttpServletResponse.SC_NOT_FOUND);
+            resp.sendError(HttpServletResponse.SC_NOT_FOUND, "Could not find " + req.getPathInfo());
         }
     }
 }

Modified: archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-web/archiva-webapp/pom.xml
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-web/archiva-webapp/pom.xml?rev=743746&r1=743745&r2=743746&view=diff
==============================================================================
--- archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-web/archiva-webapp/pom.xml (original)
+++ archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-web/archiva-webapp/pom.xml Thu Feb 12 14:03:01 2009
@@ -102,10 +102,6 @@
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-webdav</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-repository-servlet</artifactId>
     </dependency>
     <dependency>

Modified: archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java?rev=743746&r1=743745&r2=743746&view=diff
==============================================================================
--- archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java (original)
+++ archiva/branches/archiva-with-new-repoapi/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java Thu Feb 12 14:03:01 2009
@@ -434,8 +434,9 @@
 
             // At this point the incoming request can either be in default or
             // legacy layout format.
-            boolean fromProxy = fetchContentFromProxies( managedRepository, request, logicalResource );
+//            boolean fromProxy = fetchContentFromProxies( managedRepository, request, logicalResource );
 
+            boolean fromProxy = true;
             try
             {
                 // Perform an adjustment of the resource to the managed