private CvsProxySelector() { myKnownHosts = Collections.synchronizedMap(new HashMap<Pair<String, Integer>, Pair<String, Integer>>()); myAuthMap = Collections.synchronizedMap(new HashMap<Pair<String, Integer>, KeyValue<String, String>>()); myAuthenticator = new NonStaticAuthenticator() { @Override public PasswordAuthentication getPasswordAuthentication() { final KeyValue<String, String> value = myAuthMap.get(Pair.create(getRequestingHost(), getRequestingPort())); if (value != null) { return new PasswordAuthentication(value.getKey(), value.getValue().toCharArray()); } return null; } }; }
private NonStaticAuthenticator getAuthenticator() { return myAuthenticator; }