List of usage examples for org.apache.commons.collections15.keyvalue KeyedReader get
V get(K key);
From source file:org.apache.sshd.server.PasswordAuthenticatorUtils.java
/** * @param usersMap The users map as a {@link KeyedReader} object where * key=user name, value=expected password * @return A {@link PasswordAuthenticator} that authenticates using the * provided users map/*from w w w .j av a2s.c om*/ */ public static final PasswordAuthenticator mappedUsersAuthenticator(final KeyedReader<String, String> usersMap) { return new PasswordAuthenticator() { @Override public boolean authenticate(String u, String p, ServerSession session) { String password = usersMap.get(u); if (password == null) { return false; // no such user } else if (p.equals(password)) { return true; } else { return false; // debug breakpoint } } }; }