1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.eclipse.aether.internal.impl;
20
21 import javax.inject.Inject;
22 import javax.inject.Named;
23 import javax.inject.Singleton;
24
25 import org.eclipse.aether.RepositorySystemSession;
26 import org.eclipse.aether.repository.RepositoryKeyFunction;
27 import org.eclipse.aether.spi.remoterepo.RepositoryKeyFunctionFactory;
28
29 import static java.util.Objects.requireNonNull;
30
31
32
33
34
35
36
37 @Singleton
38 @Named
39 public final class DefaultLocalPathPrefixComposerFactory extends LocalPathPrefixComposerFactorySupport {
40 private final RepositoryKeyFunctionFactory repositoryKeyFunctionFactory;
41
42 @Inject
43 public DefaultLocalPathPrefixComposerFactory(RepositoryKeyFunctionFactory repositoryKeyFunctionFactory) {
44 this.repositoryKeyFunctionFactory = requireNonNull(repositoryKeyFunctionFactory);
45 }
46
47 @Override
48 public LocalPathPrefixComposer createComposer(RepositorySystemSession session) {
49 return new DefaultLocalPathPrefixComposer(
50 isSplit(session),
51 getLocalPrefix(session),
52 isSplitLocal(session),
53 getRemotePrefix(session),
54 isSplitRemote(session),
55 isSplitRemoteRepository(session),
56 isSplitRemoteRepositoryLast(session),
57 getReleasesPrefix(session),
58 getSnapshotsPrefix(session),
59 repositoryKeyFunctionFactory.systemRepositoryKeyFunction(session));
60 }
61
62
63
64
65 private static class DefaultLocalPathPrefixComposer extends LocalPathPrefixComposerSupport {
66 @SuppressWarnings("checkstyle:parameternumber")
67 private DefaultLocalPathPrefixComposer(
68 boolean split,
69 String localPrefix,
70 boolean splitLocal,
71 String remotePrefix,
72 boolean splitRemote,
73 boolean splitRemoteRepository,
74 boolean splitRemoteRepositoryLast,
75 String releasesPrefix,
76 String snapshotsPrefix,
77 RepositoryKeyFunction repositoryKeyFunction) {
78 super(
79 split,
80 localPrefix,
81 splitLocal,
82 remotePrefix,
83 splitRemote,
84 splitRemoteRepository,
85 splitRemoteRepositoryLast,
86 releasesPrefix,
87 snapshotsPrefix,
88 repositoryKeyFunction);
89 }
90 }
91 }