View Javadoc
1   package org.eclipse.aether.impl;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   * 
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   * 
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.util.Collection;
23  import java.util.List;
24  
25  import org.eclipse.aether.RepositorySystem;
26  import org.eclipse.aether.RepositorySystemSession;
27  import org.eclipse.aether.artifact.Artifact;
28  import org.eclipse.aether.resolution.ArtifactRequest;
29  import org.eclipse.aether.resolution.ArtifactResolutionException;
30  import org.eclipse.aether.resolution.ArtifactResult;
31  
32  /**
33   * Resolves artifacts, that is gets a local filesystem path to their binary contents.
34   * 
35   * @noimplement This interface is not intended to be implemented by clients.
36   * @noextend This interface is not intended to be extended by clients.
37   * @provisional This type is provisional and can be changed, moved or removed without prior notice.
38   */
39  public interface ArtifactResolver
40  {
41  
42      /**
43       * Resolves the path for an artifact. The artifact will be downloaded to the local repository if necessary. An
44       * artifact that is already resolved will be skipped and is not re-resolved. Note that this method assumes that any
45       * relocations have already been processed and the artifact coordinates are used as-is.
46       * 
47       * @param session The repository session, must not be {@code null}.
48       * @param request The resolution request, must not be {@code null}.
49       * @return The resolution result, never {@code null}.
50       * @throws ArtifactResolutionException If the artifact could not be resolved.
51       * @see Artifact#getFile()
52       * @see RepositorySystem#resolveArtifact(RepositorySystemSession, ArtifactRequest)
53       */
54      ArtifactResult resolveArtifact( RepositorySystemSession session, ArtifactRequest request )
55          throws ArtifactResolutionException;
56  
57      /**
58       * Resolves the paths for a collection of artifacts. Artifacts will be downloaded to the local repository if
59       * necessary. Artifacts that are already resolved will be skipped and are not re-resolved. Note that this method
60       * assumes that any relocations have already been processed and the artifact coordinates are used as-is.
61       * 
62       * @param session The repository session, must not be {@code null}.
63       * @param requests The resolution requests, must not be {@code null}.
64       * @return The resolution results (in request order), never {@code null}.
65       * @throws ArtifactResolutionException If any artifact could not be resolved.
66       * @see Artifact#getFile()
67       * @see RepositorySystem#resolveArtifacts(RepositorySystemSession, Collection)
68       */
69      List<ArtifactResult> resolveArtifacts( RepositorySystemSession session,
70                                             Collection<? extends ArtifactRequest> requests )
71          throws ArtifactResolutionException;
72  
73  }