]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1745] path of merged index for group configurable
authorOlivier Lamy <olamy@apache.org>
Sun, 21 Apr 2013 13:22:26 +0000 (13:22 +0000)
committerOlivier Lamy <olamy@apache.org>
Sun, 21 Apr 2013 13:22:26 +0000 (13:22 +0000)
implement backend part

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1470295 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java

index 55ffc242a76342f69559ddce1c6c194b9a321070..43b3838193fff2dc47b72f23390619f7ddd8d1ad 100644 (file)
           <required>true</required>
           <description>The id of the repository group.</description>
         </field>
+        <field>
+          <name>mergedIndexPath</name>
+          <version>1.2.0+</version>
+          <type>String</type>
+          <required>false</required>
+          <defaultValue>/.indexer</defaultValue>
+          <description>The path of the merged index.</description>
+        </field>
         <field>
           <name>repositories</name>
           <version>1.2.0+</version>
index 25fac26ad053d2f5fe7a6d21e342781b8d20903c..bc72bccceef5298b7c7440d764c35e3fb58f3a6b 100644 (file)
@@ -262,8 +262,8 @@ public class ArchivaDavResourceFactory
             // handle browse requests for virtual repos
             if ( RepositoryPathUtil.getLogicalResource( archivaLocator.getOrigResourcePath() ).endsWith( "/" ) )
             {
-                return getResource( request, repoGroupConfig.getRepositories(), archivaLocator,
-                                    archivaLocator.getRepositoryId() );
+                return getResourceFromGroup( request, repoGroupConfig.getRepositories(), archivaLocator,
+                                             repoGroupConfig );
             }
             else
             {
@@ -904,8 +904,9 @@ public class ArchivaDavResourceFactory
         }
     }
 
-    private DavResource getResource( DavServletRequest request, List<String> repositories,
-                                     ArchivaDavResourceLocator locator, String groupId )
+    private DavResource getResourceFromGroup( DavServletRequest request, List<String> repositories,
+                                              ArchivaDavResourceLocator locator,
+                                              RepositoryGroupConfiguration repositoryGroupConfiguration )
         throws DavException
     {
         List<File> mergedRepositoryContents = new ArrayList<File>();
@@ -930,9 +931,11 @@ public class ArchivaDavResourceFactory
 
             // remove last /
             String pathInfo = StringUtils.removeEnd( request.getPathInfo(), "/" );
-            if ( StringUtils.endsWith( pathInfo, "/.indexer" ) )
+            if ( StringUtils.endsWith( pathInfo, "/" + repositoryGroupConfiguration.getMergedIndexPath() )
+                || StringUtils.endsWith( pathInfo, "/" + repositoryGroupConfiguration.getMergedIndexPath() + "/" ) )
             {
-                File mergedRepoDir = buildMergedIndexDirectory( repositories, activePrincipal, request, groupId );
+                File mergedRepoDir = buildMergedIndexDirectory( repositories, activePrincipal, request,
+                                                                repositoryGroupConfiguration.getId() );
                 mergedRepositoryContents.add( mergedRepoDir );
             }
             else