1 package org.sonatype.aether.transfer;
2
3
4
5
6
7
8
9
10
11 import org.sonatype.aether.artifact.Artifact;
12 import org.sonatype.aether.repository.RemoteRepository;
13
14
15
16
17
18
19 public class ArtifactNotFoundException
20 extends ArtifactTransferException
21 {
22
23 public ArtifactNotFoundException( Artifact artifact, RemoteRepository repository )
24 {
25 super( artifact, repository, "Could not find artifact " + artifact + getString( " in ", repository )
26 + getLocalPathInfo( artifact, repository ) );
27 }
28
29 private static String getLocalPathInfo( Artifact artifact, RemoteRepository repository )
30 {
31 String localPath = ( artifact != null ) ? artifact.getProperty( "localPath", null ) : null;
32 if ( localPath != null && repository == null )
33 {
34 return " at specified path " + localPath;
35 }
36 else
37 {
38 return "";
39 }
40 }
41
42 public ArtifactNotFoundException( Artifact artifact, RemoteRepository repository, String message )
43 {
44 super( artifact, repository, message );
45 }
46
47 }