// handle browse requests for virtual repos
if ( RepositoryPathUtil.getLogicalResource( locator.getResourcePath() ).endsWith( "/" ) )
{
- return getResource( repositories, archivaLocator );
+ return getResource( request, repositories, archivaLocator );
}
}
else
}
}
- private DavResource getResource( List<String> repositories, ArchivaDavResourceLocator locator )
+ private DavResource getResource( DavServletRequest request, List<String> repositories, ArchivaDavResourceLocator locator )
throws DavException
{
List<File> mergedRepositoryContents = new ArrayList<File>();
repository + ">" );
}
- if ( !locator.getResourcePath().startsWith( ArchivaVirtualDavResource.HIDDEN_PATH_PREFIX ) )
+ if( isAuthorized( request, repository ) )
{
- if( managedRepository != null )
- {
- File resourceFile = new File( managedRepository.getRepoRoot(), logicalResource.getPath() );
- if( resourceFile.exists() )
- {
- mergedRepositoryContents.add( resourceFile );
- }
+ if ( !locator.getResourcePath().startsWith( ArchivaVirtualDavResource.HIDDEN_PATH_PREFIX ) )
+ {
+ if( managedRepository != null )
+ {
+ File resourceFile = new File( managedRepository.getRepoRoot(), logicalResource.getPath() );
+ if( resourceFile.exists() )
+ {
+ mergedRepositoryContents.add( resourceFile );
+ }
+ }
}
}
}
for( File resource : localResources )
{
List<File> files = new ArrayList<File>( Arrays.asList( resource.listFiles() ) );
- Collections.sort( files );
-
+
for ( File file : files )
{
if( uniqueChildFiles.get( file.getName() ) == null )
List<File> uniqueChildFilesInList = new ArrayList<File>();
uniqueChildFilesInList.addAll( uniqueChildFiles.values() );
+ Collections.sort( uniqueChildFilesInList );
for ( File file : uniqueChildFilesInList )
{