1 package org.sonatype.aether.transfer;
2
3
4
5
6
7
8
9
10
11 import org.sonatype.aether.RepositoryException;
12 import org.sonatype.aether.repository.RemoteRepository;
13
14
15
16
17
18
19 public class NoRepositoryConnectorException
20 extends RepositoryException
21 {
22
23 private final RemoteRepository repository;
24
25 public NoRepositoryConnectorException( RemoteRepository repository )
26 {
27 this( repository, toMessage( repository ) );
28 }
29
30 public NoRepositoryConnectorException( RemoteRepository repository, String message )
31 {
32 super( message );
33
34 this.repository = repository;
35 }
36
37 public NoRepositoryConnectorException( RemoteRepository repository, Throwable cause )
38 {
39 this( repository, toMessage( repository ), cause );
40 }
41
42 public NoRepositoryConnectorException( RemoteRepository repository, String message, Throwable cause )
43 {
44 super( message, cause );
45
46 this.repository = repository;
47 }
48
49 private static String toMessage( RemoteRepository repository )
50 {
51 if ( repository != null )
52 {
53 return "No connector available to access repository " + repository.getId() + " (" + repository.getUrl()
54 + ") of type " + repository.getContentType();
55 }
56 else
57 {
58 return "No connector available to access repository";
59 }
60 }
61
62 public RemoteRepository getRepository()
63 {
64 return repository;
65 }
66
67 }