1 package org.eclipse.aether.internal.impl;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.List;
23
24 import org.apache.commons.lang3.StringUtils;
25 import org.eclipse.aether.RepositorySystemSession;
26 import org.eclipse.aether.impl.RemoteRepositoryManager;
27 import org.eclipse.aether.repository.RemoteRepository;
28 import org.eclipse.aether.repository.RepositoryPolicy;
29
30 import static java.util.Objects.requireNonNull;
31
32 public class StubRemoteRepositoryManager
33 implements RemoteRepositoryManager
34 {
35
36 public StubRemoteRepositoryManager()
37 {
38 }
39
40 public List<RemoteRepository> aggregateRepositories( RepositorySystemSession session,
41 List<RemoteRepository> dominantRepositories,
42 List<RemoteRepository> recessiveRepositories,
43 boolean recessiveIsRaw )
44 {
45 requireNonNull( session, "session cannot be null" );
46 requireNonNull( dominantRepositories, "dominantRepositories cannot be null" );
47 requireNonNull( recessiveRepositories, "recessiveRepositories cannot be null" );
48 return dominantRepositories;
49 }
50
51 public RepositoryPolicy getPolicy( RepositorySystemSession session, RemoteRepository repository, boolean releases,
52 boolean snapshots )
53 {
54 requireNonNull( session, "session cannot be null" );
55 requireNonNull( repository, "repository cannot be null" );
56 RepositoryPolicy policy = repository.getPolicy( snapshots );
57
58 String checksums = session.getChecksumPolicy();
59 if ( StringUtils.isEmpty( checksums ) )
60 {
61 checksums = policy.getChecksumPolicy();
62 }
63 String updates = session.getUpdatePolicy();
64 if ( StringUtils.isEmpty( updates ) )
65 {
66 updates = policy.getUpdatePolicy();
67 }
68
69 policy = new RepositoryPolicy( policy.isEnabled(), updates, checksums );
70
71 return policy;
72 }
73
74 }