001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *   http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019package org.eclipse.aether.internal.impl;
020
021import javax.inject.Named;
022import javax.inject.Singleton;
023
024import org.eclipse.aether.RepositorySystemSession;
025
026/**
027 * Default local path prefix composer factory: it fully reuses {@link LocalPathPrefixComposerFactorySupport} class
028 * without changing anything from it.
029 *
030 * @since 1.8.1
031 */
032@Singleton
033@Named
034public final class DefaultLocalPathPrefixComposerFactory extends LocalPathPrefixComposerFactorySupport {
035    @Override
036    public LocalPathPrefixComposer createComposer(RepositorySystemSession session) {
037        return new DefaultLocalPathPrefixComposer(
038                isSplit(session),
039                getLocalPrefix(session),
040                isSplitLocal(session),
041                getRemotePrefix(session),
042                isSplitRemote(session),
043                isSplitRemoteRepository(session),
044                isSplitRemoteRepositoryLast(session),
045                getReleasesPrefix(session),
046                getSnapshotsPrefix(session));
047    }
048
049    /**
050     * {@link LocalPathPrefixComposer} implementation that fully reuses {@link LocalPathPrefixComposerSupport} class.
051     */
052    private static class DefaultLocalPathPrefixComposer extends LocalPathPrefixComposerSupport {
053        @SuppressWarnings("checkstyle:parameternumber")
054        private DefaultLocalPathPrefixComposer(
055                boolean split,
056                String localPrefix,
057                boolean splitLocal,
058                String remotePrefix,
059                boolean splitRemote,
060                boolean splitRemoteRepository,
061                boolean splitRemoteRepositoryLast,
062                String releasesPrefix,
063                String snapshotsPrefix) {
064            super(
065                    split,
066                    localPrefix,
067                    splitLocal,
068                    remotePrefix,
069                    splitRemote,
070                    splitRemoteRepository,
071                    splitRemoteRepositoryLast,
072                    releasesPrefix,
073                    snapshotsPrefix);
074        }
075    }
076}