/** * Creates a new authentication with the specified properties. * @param auth The authentication object. */ @SuppressWarnings("PMD.NullAssignment") public RepositoryAuthentication(final Authentication auth) { this.username = auth.getUsername(); if (auth.getPassword() == null) { this.password = null; } else { this.password = auth.getPassword().toCharArray(); } this.privatekeyfile = auth.getPrivateKeyFile(); if (auth.getPassphrase() == null) { this.passphrase = null; } else { this.passphrase = auth.getPassphrase().toCharArray(); } }
private void appendAuth( StringBuilder buffer, Authentication auth ) { if ( auth != null ) { SimpleDigest digest = new SimpleDigest(); digest.update( auth.getUsername() ); digest.update( auth.getPassword() ); digest.update( auth.getPrivateKeyFile() ); digest.update( auth.getPassphrase() ); buffer.append( digest.digest() ).append( '@' ); } }
private void appendAuth( StringBuilder buffer, Authentication auth ) { if ( auth != null ) { SimpleDigest digest = new SimpleDigest(); digest.update( auth.getUsername() ); digest.update( auth.getPassword() ); digest.update( auth.getPrivateKeyFile() ); digest.update( auth.getPassphrase() ); buffer.append( digest.digest() ).append( '@' ); } }
private AuthenticationInfo getAuthenticationInfo( RemoteRepository repository ) { AuthenticationInfo auth = null; Authentication a = repository.getAuthentication(); if ( a != null ) { auth = new AuthenticationInfo(); auth.setUserName( a.getUsername() ); auth.setPassword( a.getPassword() ); auth.setPrivateKey( a.getPrivateKeyFile() ); auth.setPassphrase( a.getPassphrase() ); } return auth; }