This project has retired. For details please refer to its
Attic page.
ArchivaRepositoryConnectorFactory xref
1 package org.apache.archiva.dependency.tree.maven2;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory;
22 import org.eclipse.aether.internal.impl.DefaultRepositoryLayoutProvider;
23 import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;
24 import org.slf4j.Logger;
25 import org.slf4j.LoggerFactory;
26 import org.eclipse.aether.RepositorySystemSession;
27 import org.eclipse.aether.repository.RemoteRepository;
28 import org.eclipse.aether.spi.connector.ArtifactDownload;
29 import org.eclipse.aether.spi.connector.ArtifactUpload;
30 import org.eclipse.aether.spi.connector.MetadataDownload;
31 import org.eclipse.aether.spi.connector.MetadataUpload;
32 import org.eclipse.aether.spi.connector.RepositoryConnector;
33 import org.eclipse.aether.transfer.NoRepositoryConnectorException;
34
35 import java.util.Collection;
36
37
38
39
40
41
42
43
44 public class ArchivaRepositoryConnectorFactory
45 implements RepositoryConnectorFactory
46 {
47
48 private BasicRepositoryConnectorFactory delegate = new BasicRepositoryConnectorFactory();
49
50 public ArchivaRepositoryConnectorFactory()
51 {
52
53 delegate.setRepositoryLayoutProvider(new DefaultRepositoryLayoutProvider());
54 }
55
56 @Override
57 public RepositoryConnector newInstance( RepositorySystemSession session, RemoteRepository repository )
58 throws NoRepositoryConnectorException
59 {
60 try
61 {
62 return delegate.newInstance( session, repository );
63 }
64 catch ( NoRepositoryConnectorException e )
65 {
66
67 }
68
69 return new RepositoryConnector()
70 {
71
72 private Logger log = LoggerFactory.getLogger( getClass() );
73
74 @Override
75 public void get( Collection<? extends ArtifactDownload> artifactDownloads,
76 Collection<? extends MetadataDownload> metadataDownloads )
77 {
78 log.debug( "get" );
79 }
80
81 @Override
82 public void put( Collection<? extends ArtifactUpload> artifactUploads,
83 Collection<? extends MetadataUpload> metadataUploads )
84 {
85 log.debug( "put" );
86 }
87
88 @Override
89 public void close()
90 {
91 log.debug( "close" );
92 }
93 };
94 }
95
96 @Override
97 public float getPriority( )
98 {
99 return 0;
100 }
101 }