summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-web
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2013-04-21 23:36:06 +0000
committerOlivier Lamy <olamy@apache.org>2013-04-21 23:36:06 +0000
commitc44809424f93da315de913feb7645d9ad253c292 (patch)
tree92102788d18f57e36a9a28d198421ae48ffd58bf /archiva-modules/archiva-web
parent0da207565c4cb4a789ea7cf581d8ede9e4143e99 (diff)
downloadarchiva-c44809424f93da315de913feb7645d9ad253c292.tar.gz
archiva-c44809424f93da315de913feb7645d9ad253c292.zip
add mergedIndexPath in repo group view
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1470364 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.java25
1 files changed, 22 insertions, 3 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 3d99333d0..79e2d4195 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
@@ -73,6 +73,7 @@ import org.apache.archiva.xml.XMLException;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.SystemUtils;
import org.apache.jackrabbit.webdav.DavException;
import org.apache.jackrabbit.webdav.DavResource;
import org.apache.jackrabbit.webdav.DavResourceFactory;
@@ -445,7 +446,7 @@ public class ArchivaDavResourceFactory
String rootPath = StringUtils.substringBeforeLast( pathInfo, "/" );
- if ( StringUtils.endsWith( rootPath, "/.indexer" ) )
+ if ( StringUtils.endsWith( rootPath, "/" + repoGroupConfig.getMergedIndexPath() ) )
{
// we are in the case of index file request
String requestedFileName = StringUtils.substringAfterLast( pathInfo, "/" );
@@ -926,11 +927,12 @@ public class ArchivaDavResourceFactory
boolean allow = isAllowedToContinue( request, repositories, activePrincipal );
+ // remove last /
+ String pathInfo = StringUtils.removeEnd( request.getPathInfo(), "/" );
+
if ( allow )
{
- // remove last /
- String pathInfo = StringUtils.removeEnd( request.getPathInfo(), "/" );
if ( StringUtils.endsWith( pathInfo, repositoryGroupConfiguration.getMergedIndexPath() ) )
{
File mergedRepoDir =
@@ -939,6 +941,23 @@ public class ArchivaDavResourceFactory
}
else
{
+ if ( StringUtils.equalsIgnoreCase( pathInfo, "/" + repositoryGroupConfiguration.getId() ) )
+ {
+ File tmpDirectory = new File( SystemUtils.getJavaIoTmpDir(),
+ repositoryGroupConfiguration.getId() + "/"
+ + repositoryGroupConfiguration.getMergedIndexPath() );
+ if ( !tmpDirectory.exists() )
+ {
+ synchronized ( tmpDirectory.getAbsolutePath() )
+ {
+ if ( !tmpDirectory.exists() )
+ {
+ tmpDirectory.mkdirs();
+ }
+ }
+ }
+ mergedRepositoryContents.add( tmpDirectory.getParentFile() );
+ }
for ( String repository : repositories )
{
ManagedRepositoryContent managedRepository = null;