@Test public void testNewChecksumPolicy_Unknown() { ChecksumPolicy policy = provider.newChecksumPolicy( session, repository, resource, CHECKSUM_POLICY_UNKNOWN ); assertNotNull( policy ); assertEquals( WarnChecksumPolicy.class, policy.getClass() ); }
public ChecksumPolicy newChecksumPolicy( RepositorySystemSession session, RemoteRepository repository, TransferResource resource, String policy ) { if ( RepositoryPolicy.CHECKSUM_POLICY_IGNORE.equals( policy ) ) { return null; } if ( RepositoryPolicy.CHECKSUM_POLICY_FAIL.equals( policy ) ) { return new FailChecksumPolicy( loggerFactory, resource ); } return new WarnChecksumPolicy( loggerFactory, resource ); }
DefaultChecksumPolicyProvider implements ChecksumPolicyProvider, Service { public ChecksumPolicy newChecksumPolicy( RepositorySystemSession session, RemoteRepository repository, TransferResource resource, String policy ) { if ( RepositoryPolicy.CHECKSUM_POLICY_IGNORE.equals( policy ) ) { return null; } if ( RepositoryPolicy.CHECKSUM_POLICY_FAIL.equals( policy ) ) { return new FailChecksumPolicy( loggerFactory, resource ); } return new WarnChecksumPolicy( loggerFactory, resource ); } }
DefaultChecksumPolicyProvider implements ChecksumPolicyProvider, Service { public ChecksumPolicy newChecksumPolicy( RepositorySystemSession session, RemoteRepository repository, TransferResource resource, String policy ) { if ( RepositoryPolicy.CHECKSUM_POLICY_IGNORE.equals( policy ) ) { return null; } if ( RepositoryPolicy.CHECKSUM_POLICY_FAIL.equals( policy ) ) { return new FailChecksumPolicy( loggerFactory, resource ); } return new WarnChecksumPolicy( loggerFactory, resource ); } DefaultChecksumPolicyProvider(); @Inject  DefaultChecksumPolicyProvider( LoggerFactory loggerFactory ); }
DefaultChecksumPolicyProvider implements ChecksumPolicyProvider, Service { public ChecksumPolicy newChecksumPolicy( RepositorySystemSession session, RemoteRepository repository, TransferResource resource, String policy ) { if ( RepositoryPolicy.CHECKSUM_POLICY_IGNORE.equals( policy ) ) { return null; } if ( RepositoryPolicy.CHECKSUM_POLICY_FAIL.equals( policy ) ) { return new FailChecksumPolicy( loggerFactory, resource ); } return new WarnChecksumPolicy( loggerFactory, resource ); } DefaultChecksumPolicyProvider(); @Inject  DefaultChecksumPolicyProvider( LoggerFactory loggerFactory ); void initService( ServiceLocator locator ); DefaultChecksumPolicyProvider setLoggerFactory( LoggerFactory loggerFactory ); ChecksumPolicy newChecksumPolicy( RepositorySystemSession session, RemoteRepository repository,
                                             TransferResource resource, String policy ); String getEffectiveChecksumPolicy( RepositorySystemSession session, String policy1, String policy2 ); }
DefaultChecksumPolicyProvider implements ChecksumPolicyProvider, Service { public ChecksumPolicy newChecksumPolicy( RepositorySystemSession session, RemoteRepository repository, TransferResource resource, String policy ) { if ( RepositoryPolicy.CHECKSUM_POLICY_IGNORE.equals( policy ) ) { return null; } if ( RepositoryPolicy.CHECKSUM_POLICY_FAIL.equals( policy ) ) { return new FailChecksumPolicy( loggerFactory, resource ); } return new WarnChecksumPolicy( loggerFactory, resource ); } DefaultChecksumPolicyProvider(); @Inject  DefaultChecksumPolicyProvider( LoggerFactory loggerFactory ); void initService( ServiceLocator locator ); DefaultChecksumPolicyProvider setLoggerFactory( LoggerFactory loggerFactory ); ChecksumPolicy newChecksumPolicy( RepositorySystemSession session, RemoteRepository repository,
                                             TransferResource resource, String policy ); String getEffectiveChecksumPolicy( RepositorySystemSession session, String policy1, String policy2 );  }