mirror of https://github.com/apache/archiva.git
MRM-872 first step : don't return first available resource, but list all available, to support "merge" when more than one is present.
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@675495 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0a94a40f00
commit
ce121d314f
|
@ -191,7 +191,7 @@ public class ArchivaDavResourceFactory
|
|||
throw new DavException(HttpServletResponse.SC_NO_CONTENT);
|
||||
}
|
||||
|
||||
DavResource resource = null;
|
||||
List<DavResource> availableResources = new ArrayList<DavResource>();
|
||||
DavException e = null;
|
||||
|
||||
for ( String repositoryId : repositories )
|
||||
|
@ -208,6 +208,7 @@ public class ArchivaDavResourceFactory
|
|||
repositoryId + ">" );
|
||||
}
|
||||
|
||||
DavResource resource = null;
|
||||
if ( !locator.getResourcePath().startsWith( ArchivaDavResource.HIDDEN_PATH_PREFIX ) )
|
||||
{
|
||||
if ( managedRepository != null )
|
||||
|
@ -242,15 +243,7 @@ public class ArchivaDavResourceFactory
|
|||
}
|
||||
else
|
||||
{
|
||||
setHeaders(response, locator, resource );
|
||||
|
||||
// compatibility with MRM-440 to ensure browsing the repository works ok
|
||||
if ( resource.isCollection() && !request.getRequestURI().endsWith("/" ) )
|
||||
{
|
||||
throw new BrowserRedirectException( resource.getHref() );
|
||||
}
|
||||
resource.addLockManager(lockManager);
|
||||
return resource;
|
||||
availableResources.add( resource );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -260,7 +253,26 @@ public class ArchivaDavResourceFactory
|
|||
}
|
||||
}
|
||||
|
||||
throw e;
|
||||
if (availableResources.isEmpty())
|
||||
{
|
||||
throw e;
|
||||
}
|
||||
|
||||
if ( request.getRequestURI().endsWith( "metadata.xml" ) )
|
||||
{
|
||||
// TODO MRM-872 : must merge all available metadatas
|
||||
}
|
||||
|
||||
DavResource resource = availableResources.get( 0 );
|
||||
setHeaders(response, locator, resource );
|
||||
|
||||
// compatibility with MRM-440 to ensure browsing the repository works ok
|
||||
if ( resource.isCollection() && !request.getRequestURI().endsWith("/" ) )
|
||||
{
|
||||
throw new BrowserRedirectException( resource.getHref() );
|
||||
}
|
||||
resource.addLockManager(lockManager);
|
||||
return resource;
|
||||
}
|
||||
|
||||
public DavResource createResource( final DavResourceLocator locator, final DavSession davSession )
|
||||
|
|
Loading…
Reference in New Issue