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 );
185 resourceFactory.setManagedRepositoryAdmin( defaultManagedRepositoryAdmin );
188 private ManagedRepository createManagedRepository( String id, String location, String layout )
190 ManagedRepository repoConfig = new ManagedRepository();
191 repoConfig.setId( id );
192 repoConfig.setName( id );
193 repoConfig.setLocation( location );
194 repoConfig.setLayout( layout );
199 private ManagedRepositoryContent createManagedRepositoryContent( String repoId )
200 throws RepositoryAdminException
202 ManagedRepositoryContent repoContent = new ManagedDefaultRepositoryContent();
203 repoContent.setRepository( defaultManagedRepositoryAdmin.getManagedRepository( repoId ) );
209 public void tearDown()
215 // MRM-1232 - Unable to get artifacts from repositories which requires Repository Manager role using repository group
217 public void testRepositoryGroupFirstRepositoryRequiresAuthentication()
220 DavResourceLocator locator = new ArchivaDavResourceLocator( "", "/repository/" + LOCAL_REPO_GROUP
221 + "/org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar", LOCAL_REPO_GROUP,
222 new ArchivaDavLocatorFactory() );
224 ManagedRepositoryContent internalRepo = createManagedRepositoryContent( INTERNAL_REPO );
225 ManagedRepositoryContent releasesRepo = createManagedRepositoryContent( RELEASES_REPO );
229 archivaConfigurationControl.reset();
231 expect( archivaConfiguration.getConfiguration() ).andReturn( config ).times( 3 );
233 expect( request.getMethod() ).andReturn( "GET" ).times( 2 );
235 expect( request.getPathInfo() ).andReturn( "org/apache/archiva" ).times( 0, 2 );
237 expect( repoFactory.getManagedRepositoryContent( RELEASES_REPO ) ).andReturn( releasesRepo );
239 expect( request.getRemoteAddr() ).andReturn( "http://localhost:8080" ).times( 2 );
241 expect( request.getDavSession() ).andReturn( new ArchivaDavSession() ).times( 2 );
243 expect( repoRequest.isSupportFile(
244 "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn( true );
247 repoRequest.isDefault( "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn(
250 expect( repoRequest.toArtifactReference(
251 "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn( null );
253 expect( repoRequest.toNativePath( "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar",
254 internalRepo ) ).andReturn(
255 new File( config.findManagedRepositoryById( INTERNAL_REPO ).getLocation(),
256 "target/test-classes/internal/org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ).getPath() );
258 expect( repoFactory.getManagedRepositoryContent( INTERNAL_REPO ) ).andReturn( internalRepo );
260 expect( repoRequest.isArchetypeCatalog(
261 "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn( false );
262 archivaConfigurationControl.replay();
263 requestControl.replay();
264 repoContentFactoryControl.replay();
265 repoRequestControl.replay();
267 resourceFactory.createResource( locator, request, response );
269 archivaConfigurationControl.verify();
270 requestControl.verify();
271 repoContentFactoryControl.verify();
272 repoRequestControl.verify();
274 fail( "A DavException with 401 error code should have been thrown." );
276 catch ( DavException e )
278 assertEquals( 401, e.getErrorCode() );
283 public void testRepositoryGroupLastRepositoryRequiresAuthentication()
286 DavResourceLocator locator = new ArchivaDavResourceLocator( "", "/repository/" + LOCAL_REPO_GROUP
287 + "/org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar", LOCAL_REPO_GROUP,
288 new ArchivaDavLocatorFactory() );
290 List<RepositoryGroupConfiguration> repoGroups = new ArrayList<RepositoryGroupConfiguration>();
291 RepositoryGroupConfiguration repoGroup = new RepositoryGroupConfiguration();
292 repoGroup.setId( LOCAL_REPO_GROUP );
293 repoGroup.addRepository( INTERNAL_REPO );
294 repoGroup.addRepository( RELEASES_REPO );
296 repoGroups.add( repoGroup );
298 config.setRepositoryGroups( repoGroups );
300 ManagedRepositoryContent internalRepo = createManagedRepositoryContent( INTERNAL_REPO );
302 ManagedRepositoryContent releasesRepo = createManagedRepositoryContent( RELEASES_REPO );
306 archivaConfigurationControl.reset();
308 expect( archivaConfiguration.getConfiguration() ).andReturn( config ).times( 3 );
310 expect( request.getMethod() ).andReturn( "GET" ).times( 2 );
312 expect( request.getPathInfo() ).andReturn( "org/apache/archiva" ).times( 0, 2 );
314 expect( repoFactory.getManagedRepositoryContent( INTERNAL_REPO ) ).andReturn( internalRepo );
316 expect( repoFactory.getManagedRepositoryContent( RELEASES_REPO ) ).andReturn( releasesRepo );
318 expect( request.getRemoteAddr() ).andReturn( "http://localhost:8080" ).times( 2 );
320 expect( request.getDavSession() ).andReturn( new ArchivaDavSession() ).times( 2 );
322 expect( repoRequest.isSupportFile(
323 "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn( false );
326 repoRequest.isDefault( "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn(
329 expect( repoRequest.toArtifactReference(
330 "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn( null );
332 expect( repoRequest.toNativePath( "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar",
333 internalRepo ) ).andReturn(
334 new File( config.findManagedRepositoryById( INTERNAL_REPO ).getLocation(),
335 "target/test-classes/internal/org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ).getPath() );
338 expect( repoRequest.isArchetypeCatalog(
339 "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn( false );
340 archivaConfigurationControl.replay();
341 requestControl.replay();
342 repoContentFactoryControl.replay();
343 repoRequestControl.replay();
345 resourceFactory.createResource( locator, request, response );
347 archivaConfigurationControl.verify();
348 requestControl.verify();
349 repoContentFactoryControl.verify();
350 repoRequestControl.verify();
352 fail( "A DavException with 401 error code should have been thrown." );
354 catch ( DavException e )
356 assertEquals( 401, e.getErrorCode() );
361 public void testRepositoryGroupArtifactDoesNotExistInAnyOfTheReposAuthenticationDisabled()
364 DavResourceLocator locator = new ArchivaDavResourceLocator( "", "/repository/" + LOCAL_REPO_GROUP
365 + "/org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar", LOCAL_REPO_GROUP,
366 new ArchivaDavLocatorFactory() );
368 defaultManagedRepositoryAdmin.addManagedRepository(
369 createManagedRepository( LOCAL_MIRROR_REPO, new File( "target/test-classes/local-mirror" ).getPath(),
370 "default" ), false, null );
372 List<RepositoryGroupConfiguration> repoGroups = new ArrayList<RepositoryGroupConfiguration>();
373 RepositoryGroupConfiguration repoGroup = new RepositoryGroupConfiguration();
374 repoGroup.setId( LOCAL_REPO_GROUP );
375 repoGroup.addRepository( INTERNAL_REPO );
376 repoGroup.addRepository( LOCAL_MIRROR_REPO );
378 repoGroups.add( repoGroup );
380 config.setRepositoryGroups( repoGroups );
382 ManagedRepositoryContent internalRepo = createManagedRepositoryContent( INTERNAL_REPO );
383 ManagedRepositoryContent localMirrorRepo = createManagedRepositoryContent( LOCAL_MIRROR_REPO );
387 archivaConfigurationControl.reset();
389 expect( archivaConfiguration.getConfiguration() ).andReturn( config ).times( 3 );
391 expect( request.getMethod() ).andReturn( "GET" ).times( 4 );
393 expect( request.getPathInfo() ).andReturn( "org/apache/archiva" ).times( 0, 2 );
395 expect( repoFactory.getManagedRepositoryContent( INTERNAL_REPO ) ).andReturn( internalRepo );
397 expect( repoFactory.getManagedRepositoryContent( LOCAL_MIRROR_REPO ) ).andReturn( localMirrorRepo );
399 expect( request.getRemoteAddr() ).andReturn( "http://localhost:8080" ).times( 4 );
401 expect( request.getDavSession() ).andReturn( new ArchivaDavSession() ).times( 4 );
403 expect( repoRequest.isSupportFile(
404 "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn( false ).times( 2 );
407 repoRequest.isDefault( "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn(
410 expect( repoRequest.toArtifactReference(
411 "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn( null ).times( 2 );
413 expect( repoRequest.toNativePath( "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar",
414 internalRepo ) ).andReturn(
415 new File( config.findManagedRepositoryById( INTERNAL_REPO ).getLocation(),
416 "target/test-classes/internal/org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ).getPath() );
418 expect( repoRequest.toNativePath( "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar",
420 .andReturn( new File( config.findManagedRepositoryById( LOCAL_MIRROR_REPO ).getLocation(),
421 "target/test-classes/internal/org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ).getPath() );
423 expect( repoRequest.isArchetypeCatalog( "org/apache/archiva/archiva/1.2-SNAPSHOT/archiva-1.2-SNAPSHOT.jar" ) ).andReturn( false ).times( 2 );
424 archivaConfigurationControl.replay();
425 requestControl.replay();
426 repoContentFactoryControl.replay();
427 repoRequestControl.replay();
429 resourceFactory.createResource( locator, request, response );
431 archivaConfigurationControl.verify();
432 requestControl.verify();
433 repoContentFactoryControl.verify();
434 repoRequestControl.verify();
436 fail( "A DavException with 404 error code should have been thrown." );
438 catch ( DavException e )
440 assertEquals( 404, e.getErrorCode() );
446 public void testRequestArtifactMetadataThreePartsRepoHasDefaultLayout()
449 // should fetch metadata
450 DavResourceLocator locator =
451 new ArchivaDavResourceLocator( "", "/repository/" + INTERNAL_REPO + "/eclipse/jdtcore/maven-metadata.xml",
452 INTERNAL_REPO, new ArchivaDavLocatorFactory() );
454 ManagedRepositoryContent internalRepo = createManagedRepositoryContent( INTERNAL_REPO );
456 // use actual object (this performs the isMetadata, isDefault and isSupportFile check!)
457 RepositoryRequest repoRequest = new RepositoryRequest( new LegacyPathParser( this.archivaConfiguration ) );
458 resourceFactory.setRepositoryRequest( repoRequest );
462 archivaConfigurationControl.reset();
464 expect( archivaConfiguration.getConfiguration() ).andReturn( config ).times( 2 );
466 expect( repoFactory.getManagedRepositoryContent( INTERNAL_REPO ) ).andReturn( internalRepo );
468 expect( request.getMethod() ).andReturn( "GET" ).times( 3 );
470 expect( request.getRemoteAddr() ).andReturn( "http://localhost:8080" ).times( 3 );
472 expect( request.getDavSession() ).andReturn( new ArchivaDavSession() ).times( 2 );
474 expect( request.getRequestURI() ).andReturn( "http://localhost:8080/archiva/repository/" + INTERNAL_REPO + "/eclipse/jdtcore/maven-metadata.xml" );
475 response.setHeader( "Pragma", "no-cache" );
479 response.setHeader( "Cache-Control", "no-cache" );
483 response.setDateHeader( eq("Last-Modified"), anyLong() );
486 archivaConfigurationControl.replay();
487 repoContentFactoryControl.replay();
488 requestControl.replay();
489 responseControl.replay();
491 resourceFactory.createResource( locator, request, response );
493 archivaConfigurationControl.verify();
494 repoContentFactoryControl.verify();
495 requestControl.verify();
496 responseControl.verify();
498 catch ( DavException e )
500 fail( "A DavException should not have been thrown!" );
505 public void testRequestArtifactMetadataTwoPartsRepoHasDefaultLayout()
508 // should not fetch metadata
509 DavResourceLocator locator =
510 new ArchivaDavResourceLocator( "", "/repository/" + INTERNAL_REPO + "/eclipse/maven-metadata.xml",
511 INTERNAL_REPO, new ArchivaDavLocatorFactory() );
513 ManagedRepositoryContent internalRepo = createManagedRepositoryContent( INTERNAL_REPO );
515 // use actual object (this performs the isMetadata, isDefault and isSupportFile check!)
516 RepositoryRequest repoRequest = new RepositoryRequest( new LegacyPathParser( this.archivaConfiguration ) );
517 resourceFactory.setRepositoryRequest( repoRequest );
521 archivaConfigurationControl.reset();
523 expect( archivaConfiguration.getConfiguration() ).andReturn( config ).times( 2 );
525 expect( repoFactory.getManagedRepositoryContent( INTERNAL_REPO ) ).andReturn( internalRepo );
527 expect( request.getMethod() ).andReturn( "GET" ).times( 3 );
529 expect( request.getRemoteAddr() ).andReturn( "http://localhost:8080" ).times( 3 );
531 expect( request.getDavSession() ).andReturn( new ArchivaDavSession() ).times( 2 );
533 archivaConfigurationControl.replay();
534 repoContentFactoryControl.replay();
535 requestControl.replay();
537 resourceFactory.createResource( locator, request, response );
539 archivaConfigurationControl.verify();
540 repoContentFactoryControl.verify();
541 requestControl.verify();
543 fail( "A 404 error should have been thrown!" );
545 catch ( DavException e )
547 assertEquals( 404, e.getErrorCode() );
552 public void testRequestMetadataRepoIsLegacy()
555 defaultManagedRepositoryAdmin.addManagedRepository(
556 createManagedRepository( LEGACY_REPO, new File( "target/test-classes/" + LEGACY_REPO ).getPath(),
557 "legacy" ), false, null );
558 DavResourceLocator locator =
559 new ArchivaDavResourceLocator( "", "/repository/" + LEGACY_REPO + "/eclipse/maven-metadata.xml",
560 LEGACY_REPO, new ArchivaDavLocatorFactory() );
562 ManagedRepositoryContent legacyRepo = createManagedRepositoryContent( LEGACY_REPO );
564 // use actual object (this performs the isMetadata, isDefault and isSupportFile check!)
565 RepositoryRequest repoRequest = new RepositoryRequest( new LegacyPathParser( this.archivaConfiguration ) );
566 resourceFactory.setRepositoryRequest( repoRequest );
570 archivaConfigurationControl.reset();
572 expect( archivaConfiguration.getConfiguration() ).andReturn( config ).times( 2 );
574 expect( repoFactory.getManagedRepositoryContent( LEGACY_REPO ) ).andReturn( legacyRepo );
576 expect( request.getMethod() ).andReturn( "GET" ).times( 2 );
578 expect( request.getRemoteAddr() ).andReturn( "http://localhost:8080" ).times( 3 );
580 expect( request.getDavSession() ).andReturn( new ArchivaDavSession() ).times( 2 );
582 archivaConfigurationControl.replay();
583 repoContentFactoryControl.replay();
584 requestControl.replay();
586 resourceFactory.createResource( locator, request, response );
588 archivaConfigurationControl.verify();
589 repoContentFactoryControl.verify();
590 requestControl.verify();
592 fail( "A 404 error should have been thrown!" );
594 catch ( DavException e )
596 assertEquals( 404, e.getErrorCode() );
600 class OverridingArchivaDavResourceFactory
601 extends ArchivaDavResourceFactory
604 OverridingArchivaDavResourceFactory( ApplicationContext applicationContext, PlexusSisuBridge plexusSisuBridge,
605 ArchivaConfiguration archivaConfiguration )
606 throws PlexusSisuBridgeException
608 super( applicationContext, plexusSisuBridge, archivaConfiguration );
611 protected boolean isAuthorized( DavServletRequest request, String repositoryId )
614 if ( RELEASES_REPO.equals( repositoryId ) )
616 throw new UnauthorizedDavException( repositoryId,
617 "You are not authenticated and authorized to access any repository." );
625 protected String getActivePrincipal( DavServletRequest request )
631 class OverridingRepositoryProxyConnectors
632 extends DefaultRepositoryProxyConnectors
634 public File fetchMetatadaFromProxies( ManagedRepositoryContent repository, String logicalPath )
636 File target = new File( repository.getRepoRoot(), logicalPath );
639 FileUtils.copyFile( new File( "target/test-classes/maven-metadata.xml" ), target );
641 catch ( IOException e )