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 org.eclipse.aether.artifact.Artifact;
023import org.eclipse.aether.metadata.Metadata;
024import org.eclipse.aether.repository.RemoteRepository;
025
026/**
027 * Composes path prefixes for {@link EnhancedLocalRepositoryManager}.
028 *
029 * @since 1.8.1
030 */
031public interface LocalPathPrefixComposer
032{
033    /**
034     * Gets the path prefix for a locally installed artifact.
035     *
036     * @param artifact The artifact for which to determine the prefix, must not be {@code null}.
037     * @return The prefix, may be {@code null} (note: {@code null}s and empty strings are treated equally).
038     */
039    String getPathPrefixForLocalArtifact( Artifact artifact );
040
041    /**
042     * Gets the path prefix for an artifact cached from a remote repository.
043     *
044     * @param artifact      The artifact for which to determine the prefix, must not be {@code null}.
045     * @param repository    The remote repository, never {@code null}.
046     * @return The prefix, may be {@code null} (note: {@code null}s and empty strings are treated equally).
047     */
048    String getPathPrefixForRemoteArtifact( Artifact artifact, RemoteRepository repository );
049
050    /**
051     * Gets the path prefix for locally installed metadata.
052     *
053     * @param metadata The metadata for which to determine the prefix, must not be {@code null}.
054     * @return The prefix, may be {@code null} (note: {@code null}s and empty strings are treated equally).
055     */
056    String getPathPrefixForLocalMetadata( Metadata metadata );
057
058    /**
059     * Gets the path prefix for metadata cached from a remote repository.
060     *
061     * @param metadata      The metadata for which to determine the prefix, must not be {@code null}.
062     * @param repository    The remote repository, never {@code null}.
063     * @return The prefix, may be {@code null} (note: {@code null}s and empty strings are treated equally).
064     */
065    String getPathPrefixForRemoteMetadata( Metadata metadata, RemoteRepository repository );
066}