1 package org.apache.maven.repository;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.File;
23
24 import org.apache.maven.artifact.Artifact;
25 import org.apache.maven.artifact.metadata.ArtifactMetadata;
26 import org.apache.maven.artifact.repository.ArtifactRepository;
27
28 public class UserLocalArtifactRepository
29 extends LocalArtifactRepository
30 {
31 private ArtifactRepository localRepository;
32
33 public UserLocalArtifactRepository( ArtifactRepository localRepository )
34 {
35 this.localRepository = localRepository;
36 setLayout( localRepository.getLayout() );
37 }
38
39 @Override
40 public Artifact find( Artifact artifact )
41 {
42 File artifactFile = new File( localRepository.getBasedir(), pathOf( artifact ) );
43
44
45
46 artifact.setFile( artifactFile );
47
48 return artifact;
49 }
50
51 @Override
52 public String getId()
53 {
54 return localRepository.getId();
55 }
56
57 @Override
58 public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository )
59 {
60 return localRepository.pathOfLocalRepositoryMetadata( metadata, repository );
61 }
62
63 @Override
64 public String pathOf( Artifact artifact )
65 {
66 return localRepository.pathOf( artifact );
67 }
68
69 @Override
70 public boolean hasLocalMetadata()
71 {
72 return true;
73 }
74 }