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