View Javadoc
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.spi.connector.checksum;
20  
21  import java.util.List;
22  import java.util.Map;
23  
24  import org.eclipse.aether.RepositorySystemSession;
25  import org.eclipse.aether.spi.connector.ArtifactDownload;
26  
27  /**
28   * Component able to provide (expected) checksums to connector beforehand the download happens. Checksum provided by
29   * this component are of kind {@link org.eclipse.aether.spi.connector.checksum.ChecksumPolicy.ChecksumKind#PROVIDED}.
30   *
31   * @since 1.8.0
32   * @deprecated This interface is not used anymore, use {@link org.eclipse.aether.spi.checksums.ProvidedChecksumsSource}.
33   */
34  @Deprecated
35  public interface ProvidedChecksumsSource {
36      /**
37       * May return the provided checksums (for given artifact transfer) from source other than remote repository, or
38       * {@code null} if it have no checksums available for given transfer. Provided checksums are "opt-in" for
39       * transfer, in a way IF they are available upfront, they will be enforced according to checksum policy
40       * in effect. Otherwise, provided checksum verification is completely left out.
41       * <p>
42       * For enabled provided checksum source is completely acceptable to return {@code null} values, as that carries
43       * the meaning "nothing to add here", as there are no checksums to be provided upfront transfer. Semantically, this
44       * is equivalent to returning empty map, but signals the intent better.
45       *
46       * @param transfer                   The transfer that is about to be executed.
47       * @param checksumAlgorithmFactories The checksum algorithms that are expected.
48       * @return Map of expected checksums, or {@code null}.
49       */
50      Map<String, String> getProvidedArtifactChecksums(
51              RepositorySystemSession session,
52              ArtifactDownload transfer,
53              List<ChecksumAlgorithmFactory> checksumAlgorithmFactories);
54  }