1 package org.apache.archiva.dependency.tree.maven2;
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
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;
35 import java.util.Collection;
39 * Creates a dummy connector, if the default connectory factory fails to create one.
41 * @author Olivier Lamy
44 public class ArchivaRepositoryConnectorFactory
45 implements RepositoryConnectorFactory
48 private BasicRepositoryConnectorFactory delegate = new BasicRepositoryConnectorFactory();
50 public ArchivaRepositoryConnectorFactory()
52 // no op but empty constructor needed by aether
53 delegate.setRepositoryLayoutProvider(new DefaultRepositoryLayoutProvider());
57 public RepositoryConnector newInstance( RepositorySystemSession session, RemoteRepository repository )
58 throws NoRepositoryConnectorException
62 return delegate.newInstance( session, repository );
64 catch ( NoRepositoryConnectorException e )
69 return new RepositoryConnector()
72 private Logger log = LoggerFactory.getLogger( getClass() );
75 public void get( Collection<? extends ArtifactDownload> artifactDownloads,
76 Collection<? extends MetadataDownload> metadataDownloads )
82 public void put( Collection<? extends ArtifactUpload> artifactUploads,
83 Collection<? extends MetadataUpload> metadataUploads )
97 public float getPriority( )