1 package org.apache.archiva.webdav;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import junit.framework.TestCase;
23 import org.apache.archiva.admin.model.RepositoryAdminException;
24 import org.apache.archiva.admin.model.beans.ManagedRepository;
25 import org.apache.archiva.admin.model.beans.RepositoryGroup;
26 import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin;
27 import org.apache.archiva.admin.repository.DefaultRepositoryCommonValidator;
28 import org.apache.archiva.admin.repository.group.DefaultRepositoryGroupAdmin;
29 import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin;
30 import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
31 import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
32 import org.apache.archiva.configuration.ArchivaConfiguration;
33 import org.apache.archiva.configuration.Configuration;
34 import org.apache.archiva.configuration.RepositoryGroupConfiguration;
35 import org.apache.archiva.proxy.DefaultRepositoryProxyConnectors;
36 import org.apache.archiva.repository.ManagedRepositoryContent;
37 import org.apache.archiva.repository.RepositoryContentFactory;
38 import org.apache.archiva.repository.content.legacy.LegacyPathParser;
39 import org.apache.archiva.repository.content.maven2.ManagedDefaultRepositoryContent;
40 import org.apache.archiva.repository.content.maven2.RepositoryRequest;
41 import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
42 import org.apache.commons.io.FileUtils;
43 import org.apache.jackrabbit.webdav.DavException;
44 import org.apache.jackrabbit.webdav.DavResourceLocator;
45 import org.apache.jackrabbit.webdav.DavServletRequest;
46 import org.apache.jackrabbit.webdav.DavServletResponse;
48 import org.easymock.IMocksControl;
49 import org.junit.After;
50 import org.junit.Before;
51 import org.junit.Test;
52 import org.junit.runner.RunWith;
53 import org.springframework.context.ApplicationContext;
54 import org.springframework.test.context.ContextConfiguration;
56 import javax.inject.Inject;
58 import java.io.IOException;
59 import java.util.ArrayList;
60 import java.util.List;
62 import static org.easymock.EasyMock.*;
65 * ArchivaDavResourceFactoryTest
67 @RunWith( ArchivaSpringJUnit4ClassRunner.class )
68 @ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml" } )
69 public class ArchivaDavResourceFactoryTest
72 private static final String RELEASES_REPO = "releases";
74 private static final String INTERNAL_REPO = "internal";
76 private static final String LOCAL_MIRROR_REPO = "local-mirror";
78 private static final String LEGACY_REPO = "legacy-repo";
80 private static final String LOCAL_REPO_GROUP = "local";
82 private OverridingArchivaDavResourceFactory resourceFactory;
84 private IMocksControl requestControl;
86 private DavServletRequest request;
88 private IMocksControl repoRequestControl;
90 private RepositoryRequest repoRequest;
92 private IMocksControl responseControl;
94 private DavServletResponse response;
96 private IMocksControl archivaConfigurationControl;
98 private ArchivaConfiguration archivaConfiguration;
100 private Configuration config;
102 private IMocksControl repoContentFactoryControl;
104 private RepositoryContentFactory repoFactory;
107 ApplicationContext applicationContext;
110 PlexusSisuBridge plexusSisuBridge;
113 DefaultManagedRepositoryAdmin defaultManagedRepositoryAdmin;
116 RemoteRepositoryAdmin remoteRepositoryAdmin;
120 DefaultRepositoryGroupAdmin defaultRepositoryGroupAdmin;
129 requestControl = createControl();
130 request = requestControl.createMock( DavServletRequest.class );
132 responseControl = createControl();
133 response = responseControl.createMock( DavServletResponse.class );
134 //responseControl.setDefaultMatcher( MockControl.ALWAYS_MATCHER );
136 archivaConfigurationControl = createControl();
137 archivaConfiguration = archivaConfigurationControl.createMock( ArchivaConfiguration.class );
139 config = new Configuration();
140 expect( archivaConfiguration.getConfiguration() ).andReturn( config ).times( 5, 20 );
141 archivaConfiguration.save( config );
143 expectLastCall().times( 1, 4 );
144 archivaConfigurationControl.replay();
146 defaultManagedRepositoryAdmin.setArchivaConfiguration( archivaConfiguration );
147 ( (DefaultRepositoryCommonValidator) defaultManagedRepositoryAdmin.getRepositoryCommonValidator() ).setArchivaConfiguration(
148 archivaConfiguration );
149 if ( defaultManagedRepositoryAdmin.getManagedRepository( RELEASES_REPO ) == null )
151 defaultManagedRepositoryAdmin.addManagedRepository(
152 createManagedRepository( RELEASES_REPO, new File( "target/test-classes/" + RELEASES_REPO ).getPath(),
153 "default" ), false, null );
155 if ( defaultManagedRepositoryAdmin.getManagedRepository( INTERNAL_REPO ) == null )
157 defaultManagedRepositoryAdmin.addManagedRepository(
158 createManagedRepository( INTERNAL_REPO, new File( "target/test-classes/" + INTERNAL_REPO ).getPath(),
159 "default" ), false, null );
161 RepositoryGroup repoGroupConfig = new RepositoryGroup();
162 repoGroupConfig.setId( LOCAL_REPO_GROUP );
163 repoGroupConfig.addRepository( RELEASES_REPO );
164 repoGroupConfig.addRepository( INTERNAL_REPO );
166 defaultRepositoryGroupAdmin.setArchivaConfiguration( archivaConfiguration );
167 if ( defaultManagedRepositoryAdmin.getManagedRepository( LOCAL_REPO_GROUP ) == null )
169 defaultRepositoryGroupAdmin.addRepositoryGroup( repoGroupConfig, null );
172 repoContentFactoryControl = createControl();
173 repoFactory = repoContentFactoryControl.createMock( RepositoryContentFactory.class );
175 repoRequestControl = createControl();
176 repoRequest = repoRequestControl.createMock( RepositoryRequest.class );
179 new OverridingArchivaDavResourceFactory( applicationContext, plexusSisuBridge, archivaConfiguration );
180 resourceFactory.setArchivaConfiguration( archivaConfiguration );
181 resourceFactory.setRepositoryFactory( repoFactory );
182 resourceFactory.setRepositoryRequest( repoRequest );
183 resourceFactory.setConnectors( new OverridingRepositoryProxyConnectors() );
184 resourceFactory.setRemoteRepositoryAdmin( remoteRepositoryAdmin );
187 private ManagedRepository createManagedRepository( String id, String location, String layout )
189 ManagedRepository repoConfig = new ManagedRepository();
190 repoConfig.setId( id );
191 repoConfig.setName( id );
192 repoConfig.setLocation( location );
193 repoConfig.setLayout( layout );
198 private ManagedRepositoryContent createManagedRepositoryContent( String repoId )
199 throws RepositoryAdminException
201 ManagedRepositoryContent repoContent = new ManagedDefaultRepositoryContent();
202 repoContent.setRepository( defaultManagedRepositoryAdmin.getManagedRepository( repoId ) );
208 public void tearDown()
214 // MRM-1232 - Unable to get artifacts from repositories which requires Repository Manager role using repository group
216 public void testRepositoryGroupFirstRepositoryRequiresAuthentication()
219 DavResourceLocator locator = new ArchivaDavResourceLocator( "", "/repository/" + LOCAL_REPO_GROUP
220 + "/org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar", LOCAL_REPO_GROUP,
221 new ArchivaDavLocatorFactory() );
223 ManagedRepositoryContent internalRepo = createManagedRepositoryContent( INTERNAL_REPO );
224 ManagedRepositoryContent releasesRepo = createManagedRepositoryContent( RELEASES_REPO );
228 archivaConfigurationControl.reset();
230 expect( archivaConfiguration.getConfiguration() ).andReturn( config );
232 expect( request.getMethod() ).andReturn( "GET" ).times( 2 );
234 expect( request.getPathInfo() ).andReturn( "org/apache/archiva" ).times( 0, 2 );
236 expect( repoFactory.getManagedRepositoryContent( RELEASES_REPO ) ).andReturn( releasesRepo );
238 expect( request.getRemoteAddr() ).andReturn( "http://localhost:8080" ).times( 2 );
240 expect( request.getDavSession() ).andReturn( new ArchivaDavSession() ).times( 2 );
242 expect( repoRequest.isSupportFile(
243 "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn( true );
246 repoRequest.isDefault( "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn(
249 expect( repoRequest.toArtifactReference(
250 "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn( null );
252 expect( repoRequest.toNativePath( "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar",
253 internalRepo ) ).andReturn(
254 new File( config.findManagedRepositoryById( INTERNAL_REPO ).getLocation(),
255 "target/test-classes/internal/org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ).getPath() );
257 expect( repoFactory.getManagedRepositoryContent( INTERNAL_REPO ) ).andReturn( internalRepo );
259 expect( repoRequest.isArchetypeCatalog(
260 "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn( false );
261 archivaConfigurationControl.replay();
262 requestControl.replay();
263 repoContentFactoryControl.replay();
264 repoRequestControl.replay();
266 resourceFactory.createResource( locator, request, response );
268 archivaConfigurationControl.verify();
269 requestControl.verify();
270 repoContentFactoryControl.verify();
271 repoRequestControl.verify();
273 fail( "A DavException with 401 error code should have been thrown." );
275 catch ( DavException e )
277 assertEquals( 401, e.getErrorCode() );
282 public void testRepositoryGroupLastRepositoryRequiresAuthentication()
285 DavResourceLocator locator = new ArchivaDavResourceLocator( "", "/repository/" + LOCAL_REPO_GROUP
286 + "/org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar", LOCAL_REPO_GROUP,
287 new ArchivaDavLocatorFactory() );
289 List<RepositoryGroupConfiguration> repoGroups = new ArrayList<RepositoryGroupConfiguration>();
290 RepositoryGroupConfiguration repoGroup = new RepositoryGroupConfiguration();
291 repoGroup.setId( LOCAL_REPO_GROUP );
292 repoGroup.addRepository( INTERNAL_REPO );
293 repoGroup.addRepository( RELEASES_REPO );
295 repoGroups.add( repoGroup );
297 config.setRepositoryGroups( repoGroups );
299 ManagedRepositoryContent internalRepo = createManagedRepositoryContent( INTERNAL_REPO );
301 ManagedRepositoryContent releasesRepo = createManagedRepositoryContent( RELEASES_REPO );
305 archivaConfigurationControl.reset();
307 expect( archivaConfiguration.getConfiguration() ).andReturn( config );
309 expect( request.getMethod() ).andReturn( "GET" ).times( 2 );
311 expect( request.getPathInfo() ).andReturn( "org/apache/archiva" ).times( 0, 2 );
313 expect( repoFactory.getManagedRepositoryContent( INTERNAL_REPO ) ).andReturn( internalRepo );
315 expect( repoFactory.getManagedRepositoryContent( RELEASES_REPO ) ).andReturn( releasesRepo );
317 expect( request.getRemoteAddr() ).andReturn( "http://localhost:8080" ).times( 2 );
319 expect( request.getDavSession() ).andReturn( new ArchivaDavSession() ).times( 2 );
321 expect( repoRequest.isSupportFile(
322 "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn( false );
325 repoRequest.isDefault( "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn(
328 expect( repoRequest.toArtifactReference(
329 "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn( null );
331 expect( repoRequest.toNativePath( "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar",
332 internalRepo ) ).andReturn(
333 new File( config.findManagedRepositoryById( INTERNAL_REPO ).getLocation(),
334 "target/test-classes/internal/org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ).getPath() );
337 expect( repoRequest.isArchetypeCatalog(
338 "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn( false );
339 archivaConfigurationControl.replay();
340 requestControl.replay();
341 repoContentFactoryControl.replay();
342 repoRequestControl.replay();
344 resourceFactory.createResource( locator, request, response );
346 archivaConfigurationControl.verify();
347 requestControl.verify();
348 repoContentFactoryControl.verify();
349 repoRequestControl.verify();
351 fail( "A DavException with 401 error code should have been thrown." );
353 catch ( DavException e )
355 assertEquals( 401, e.getErrorCode() );
360 public void testRepositoryGroupArtifactDoesNotExistInAnyOfTheReposAuthenticationDisabled()
363 DavResourceLocator locator = new ArchivaDavResourceLocator( "", "/repository/" + LOCAL_REPO_GROUP
364 + "/org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar", LOCAL_REPO_GROUP,
365 new ArchivaDavLocatorFactory() );
367 defaultManagedRepositoryAdmin.addManagedRepository(
368 createManagedRepository( LOCAL_MIRROR_REPO, new File( "target/test-classes/local-mirror" ).getPath(),
369 "default" ), false, null );
371 List<RepositoryGroupConfiguration> repoGroups = new ArrayList<RepositoryGroupConfiguration>();
372 RepositoryGroupConfiguration repoGroup = new RepositoryGroupConfiguration();
373 repoGroup.setId( LOCAL_REPO_GROUP );
374 repoGroup.addRepository( INTERNAL_REPO );
375 repoGroup.addRepository( LOCAL_MIRROR_REPO );
377 repoGroups.add( repoGroup );
379 config.setRepositoryGroups( repoGroups );
381 ManagedRepositoryContent internalRepo = createManagedRepositoryContent( INTERNAL_REPO );
382 ManagedRepositoryContent localMirrorRepo = createManagedRepositoryContent( LOCAL_MIRROR_REPO );
386 archivaConfigurationControl.reset();
388 expect( archivaConfiguration.getConfiguration() ).andReturn( config );
390 expect( request.getMethod() ).andReturn( "GET" ).times( 4 );
392 expect( request.getPathInfo() ).andReturn( "org/apache/archiva" ).times( 0, 2 );
394 expect( repoFactory.getManagedRepositoryContent( INTERNAL_REPO ) ).andReturn( internalRepo );
396 expect( repoFactory.getManagedRepositoryContent( LOCAL_MIRROR_REPO ) ).andReturn( localMirrorRepo );
398 expect( request.getRemoteAddr() ).andReturn( "http://localhost:8080" ).times( 4 );
400 expect( request.getDavSession() ).andReturn( new ArchivaDavSession() ).times( 4 );
402 expect( repoRequest.isSupportFile(
403 "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn( false ).times( 2 );
406 repoRequest.isDefault( "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn(
409 expect( repoRequest.toArtifactReference(
410 "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn( null ).times( 2 );
412 expect( repoRequest.toNativePath( "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar",
413 internalRepo ) ).andReturn(
414 new File( config.findManagedRepositoryById( INTERNAL_REPO ).getLocation(),
415 "target/test-classes/internal/org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ).getPath() );
417 expect( repoRequest.toNativePath( "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar",
419 .andReturn( new File( config.findManagedRepositoryById( LOCAL_MIRROR_REPO ).getLocation(),
420 "target/test-classes/internal/org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ).getPath() );
422 expect( repoRequest.isArchetypeCatalog( "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn( false ).times( 2 );
423 archivaConfigurationControl.replay();
424 requestControl.replay();
425 repoContentFactoryControl.replay();
426 repoRequestControl.replay();
428 resourceFactory.createResource( locator, request, response );
430 archivaConfigurationControl.verify();
431 requestControl.verify();
432 repoContentFactoryControl.verify();
433 repoRequestControl.verify();
435 fail( "A DavException with 404 error code should have been thrown." );
437 catch ( DavException e )
439 assertEquals( 404, e.getErrorCode() );
445 public void testRequestArtifactMetadataThreePartsRepoHasDefaultLayout()
448 // should fetch metadata
449 DavResourceLocator locator =
450 new ArchivaDavResourceLocator( "", "/repository/" + INTERNAL_REPO + "/eclipse/jdtcore/maven-metadata.xml",
451 INTERNAL_REPO, new ArchivaDavLocatorFactory() );
453 ManagedRepositoryContent internalRepo = createManagedRepositoryContent( INTERNAL_REPO );
455 // use actual object (this performs the isMetadata, isDefault and isSupportFile check!)
456 RepositoryRequest repoRequest = new RepositoryRequest( new LegacyPathParser( this.archivaConfiguration ) );
457 resourceFactory.setRepositoryRequest( repoRequest );
461 archivaConfigurationControl.reset();
463 expect( archivaConfiguration.getConfiguration() ).andReturn( config );
465 expect( repoFactory.getManagedRepositoryContent( INTERNAL_REPO ) ).andReturn( internalRepo );
467 expect( request.getMethod() ).andReturn( "GET" ).times( 3 );
469 expect( request.getRemoteAddr() ).andReturn( "http://localhost:8080" ).times( 3 );
471 expect( request.getDavSession() ).andReturn( new ArchivaDavSession() ).times( 2 );
473 expect( request.getRequestURI() ).andReturn( "http://localhost:8080/archiva/repository/" + INTERNAL_REPO + "/eclipse/jdtcore/maven-metadata.xml" );
474 response.setHeader( "Pragma", "no-cache" );
478 response.setHeader( "Cache-Control", "no-cache" );
482 response.setDateHeader( eq("Last-Modified"), anyLong() );
485 archivaConfigurationControl.replay();
486 repoContentFactoryControl.replay();
487 requestControl.replay();
488 responseControl.replay();
490 resourceFactory.createResource( locator, request, response );
492 archivaConfigurationControl.verify();
493 repoContentFactoryControl.verify();
494 requestControl.verify();
495 responseControl.verify();
497 catch ( DavException e )
499 fail( "A DavException should not have been thrown!" );
504 public void testRequestArtifactMetadataTwoPartsRepoHasDefaultLayout()
507 // should not fetch metadata
508 DavResourceLocator locator =
509 new ArchivaDavResourceLocator( "", "/repository/" + INTERNAL_REPO + "/eclipse/maven-metadata.xml",
510 INTERNAL_REPO, new ArchivaDavLocatorFactory() );
512 ManagedRepositoryContent internalRepo = createManagedRepositoryContent( INTERNAL_REPO );
514 // use actual object (this performs the isMetadata, isDefault and isSupportFile check!)
515 RepositoryRequest repoRequest = new RepositoryRequest( new LegacyPathParser( this.archivaConfiguration ) );
516 resourceFactory.setRepositoryRequest( repoRequest );
520 archivaConfigurationControl.reset();
522 expect( archivaConfiguration.getConfiguration() ).andReturn( config );
524 expect( repoFactory.getManagedRepositoryContent( INTERNAL_REPO ) ).andReturn( internalRepo );
526 expect( request.getMethod() ).andReturn( "GET" ).times( 2 );
528 expect( request.getRemoteAddr() ).andReturn( "http://localhost:8080" ).times( 2 );
530 expect( request.getDavSession() ).andReturn( new ArchivaDavSession() ).times( 2 );
532 archivaConfigurationControl.replay();
533 repoContentFactoryControl.replay();
534 requestControl.replay();
536 resourceFactory.createResource( locator, request, response );
538 archivaConfigurationControl.verify();
539 repoContentFactoryControl.verify();
540 requestControl.verify();
542 fail( "A 404 error should have been thrown!" );
544 catch ( DavException e )
546 assertEquals( 404, e.getErrorCode() );
551 public void testRequestMetadataRepoIsLegacy()
554 defaultManagedRepositoryAdmin.addManagedRepository(
555 createManagedRepository( LEGACY_REPO, new File( "target/test-classes/" + LEGACY_REPO ).getPath(),
556 "legacy" ), false, null );
557 DavResourceLocator locator =
558 new ArchivaDavResourceLocator( "", "/repository/" + LEGACY_REPO + "/eclipse/maven-metadata.xml",
559 LEGACY_REPO, new ArchivaDavLocatorFactory() );
561 ManagedRepositoryContent legacyRepo = createManagedRepositoryContent( LEGACY_REPO );
563 // use actual object (this performs the isMetadata, isDefault and isSupportFile check!)
564 RepositoryRequest repoRequest = new RepositoryRequest( new LegacyPathParser( this.archivaConfiguration ) );
565 resourceFactory.setRepositoryRequest( repoRequest );
569 archivaConfigurationControl.reset();
571 expect( archivaConfiguration.getConfiguration() ).andReturn( config );
573 expect( repoFactory.getManagedRepositoryContent( LEGACY_REPO ) ).andReturn( legacyRepo );
575 expect( request.getMethod() ).andReturn( "GET" ).times( 2 );
577 expect( request.getRemoteAddr() ).andReturn( "http://localhost:8080" ).times( 2 );
579 expect( request.getDavSession() ).andReturn( new ArchivaDavSession() ).times( 2 );
581 archivaConfigurationControl.replay();
582 repoContentFactoryControl.replay();
583 requestControl.replay();
585 resourceFactory.createResource( locator, request, response );
587 archivaConfigurationControl.verify();
588 repoContentFactoryControl.verify();
589 requestControl.verify();
591 fail( "A 404 error should have been thrown!" );
593 catch ( DavException e )
595 assertEquals( 404, e.getErrorCode() );
599 class OverridingArchivaDavResourceFactory
600 extends ArchivaDavResourceFactory
603 OverridingArchivaDavResourceFactory( ApplicationContext applicationContext, PlexusSisuBridge plexusSisuBridge,
604 ArchivaConfiguration archivaConfiguration )
605 throws PlexusSisuBridgeException
607 super( applicationContext, plexusSisuBridge, archivaConfiguration );
610 protected boolean isAuthorized( DavServletRequest request, String repositoryId )
613 if ( RELEASES_REPO.equals( repositoryId ) )
615 throw new UnauthorizedDavException( repositoryId,
616 "You are not authenticated and authorized to access any repository." );
624 protected String getActivePrincipal( DavServletRequest request )
630 class OverridingRepositoryProxyConnectors
631 extends DefaultRepositoryProxyConnectors
633 public File fetchMetatadaFromProxies( ManagedRepositoryContent repository, String logicalPath )
635 File target = new File( repository.getRepoRoot(), logicalPath );
638 FileUtils.copyFile( new File( "target/test-classes/maven-metadata.xml" ), target );
640 catch ( IOException e )