Package org.sonatype.nexus.proxy.maven

Examples of org.sonatype.nexus.proxy.maven.ChecksumPolicy


  @Test
  public void testPolicyIgnore()
      throws Exception
  {
    ChecksumPolicy policy = ChecksumPolicy.IGNORE;

    // it should simply pull all four without problem
    StorageFileItem file = requestWithPolicy(policy, ITEM_WITH_SHA1_AND_MD5);
    checkForFileAndMatchContents(file);
    // IGNORE: the req ignores checksum
View Full Code Here


  @Test
  public void testPolicyWarn()
      throws Exception
  {
    ChecksumPolicy policy = ChecksumPolicy.WARN;

    // it should simply pull all four without problem
    StorageFileItem file = requestWithPolicy(policy, ITEM_WITH_SHA1_AND_MD5);
    checkForFileAndMatchContents(file);
    // WARN: the req implicitly gets the "best" checksum available implicitly
View Full Code Here

  @Test
  public void testPolicyStrictIfExists()
      throws Exception
  {
    ChecksumPolicy policy = ChecksumPolicy.STRICT_IF_EXISTS;

    // it should simply pull all four without problem
    StorageFileItem file = requestWithPolicy(policy, ITEM_WITH_SHA1_AND_MD5);
    checkForFileAndMatchContents(file);
    // STRICT_IF_EXISTS: the req implicitly gets the "best" checksum available implicitly
View Full Code Here

  @Test
  public void testPolicyStrict()
      throws Exception
  {
    ChecksumPolicy policy = ChecksumPolicy.STRICT;

    // it should simply pull all four without problem
    StorageFileItem file = requestWithPolicy(policy, ITEM_WITH_SHA1_AND_MD5);
    checkForFileAndMatchContents(file);
    // STRICT: the req implicitly gets the "best" checksum available implicitly
View Full Code Here

              RepositoryPolicy repoPolicy =
                  EnumUtil.valueOf(model.getRepoPolicy(), RepositoryPolicy.class);
              repository.adaptToFacet(MavenRepository.class).setRepositoryPolicy(repoPolicy);

              if (repository.getRepositoryKind().isFacetAvailable(MavenProxyRepository.class)) {
                ChecksumPolicy checksum =
                    EnumUtil.valueOf(model.getChecksumPolicy(), ChecksumPolicy.class);

                MavenProxyRepository pRepository = repository.adaptToFacet(MavenProxyRepository.class);
                pRepository.setChecksumPolicy(checksum);
View Full Code Here

      return ChecksumPolicy.IGNORE;
    }

    final P2ProxyRepository p2repo = proxy.adaptToFacet(P2ProxyRepository.class);

    final ChecksumPolicy checksumPolicy = p2repo.getChecksumPolicy();

    if (checksumPolicy == null || !checksumPolicy.shouldCheckChecksum()
        || !(item instanceof DefaultStorageFileItem)) {
      // there is either no need to validate or we can't validate the item content
      return ChecksumPolicy.IGNORE;
    }
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.proxy.maven.ChecksumPolicy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.