1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package org.eclipse.aether.internal.impl;
20
21 import javax.inject.Named;
22 import javax.inject.Singleton;
23
24 import org.eclipse.aether.RepositorySystemSession;
25
26 /**
27 * Default local path prefix composer factory: it fully reuses {@link LocalPathPrefixComposerFactorySupport} class
28 * without changing anything from it.
29 *
30 * @since 1.8.1
31 */
32 @Singleton
33 @Named
34 public final class DefaultLocalPathPrefixComposerFactory extends LocalPathPrefixComposerFactorySupport {
35 @Override
36 public LocalPathPrefixComposer createComposer(RepositorySystemSession session) {
37 return new DefaultLocalPathPrefixComposer(
38 isSplit(session),
39 getLocalPrefix(session),
40 isSplitLocal(session),
41 getRemotePrefix(session),
42 isSplitRemote(session),
43 isSplitRemoteRepository(session),
44 isSplitRemoteRepositoryLast(session),
45 getReleasesPrefix(session),
46 getSnapshotsPrefix(session));
47 }
48
49 /**
50 * {@link LocalPathPrefixComposer} implementation that fully reuses {@link LocalPathPrefixComposerSupport} class.
51 */
52 private static class DefaultLocalPathPrefixComposer extends LocalPathPrefixComposerSupport {
53 @SuppressWarnings("checkstyle:parameternumber")
54 private DefaultLocalPathPrefixComposer(
55 boolean split,
56 String localPrefix,
57 boolean splitLocal,
58 String remotePrefix,
59 boolean splitRemote,
60 boolean splitRemoteRepository,
61 boolean splitRemoteRepositoryLast,
62 String releasesPrefix,
63 String snapshotsPrefix) {
64 super(
65 split,
66 localPrefix,
67 splitLocal,
68 remotePrefix,
69 splitRemote,
70 splitRemoteRepository,
71 splitRemoteRepositoryLast,
72 releasesPrefix,
73 snapshotsPrefix);
74 }
75 }
76 }