@Test public void testLookup() { OpenSSHHostnameConfigurator c = new OpenSSHHostnameConfigurator( new OpenSshConfig( new Local("src/test/resources", "openssh/config"))); assertEquals("cyberduck.ch", c.getHostname("alias")); }
@Override public String getHostname(final String alias) { if(StringUtils.isBlank(alias)) { return alias; } final String hostname = configuration.lookup(alias).getHostName(); if(StringUtils.isBlank(hostname)) { return alias; } if(log.isInfoEnabled()) { log.info(String.format("Using hostname alias %s from %s", alias, configuration)); } return hostname; }
OpenSSHHostnameConfigurator implements HostnameConfigurator { @Override public String getHostname(final String alias) { if(StringUtils.isBlank(alias)) { return alias; } final String hostname = configuration.lookup(alias).getHostName(); if(StringUtils.isBlank(hostname)) { return alias; } if(log.isInfoEnabled()) { log.info(String.format("Using hostname alias %s from %s", alias, configuration)); } return hostname; } }
OpenSSHHostnameConfigurator implements HostnameConfigurator { @Override public String getHostname(final String alias) { if(StringUtils.isBlank(alias)) { return alias; } final String hostname = configuration.lookup(alias).getHostName(); if(StringUtils.isBlank(hostname)) { return alias; } if(log.isInfoEnabled()) { log.info(String.format("Using hostname alias %s from %s", alias, configuration)); } return hostname; } OpenSSHHostnameConfigurator();  OpenSSHHostnameConfigurator(final OpenSshConfig configuration); }
OpenSSHHostnameConfigurator implements HostnameConfigurator { @Override public String getHostname(final String alias) { if(StringUtils.isBlank(alias)) { return alias; } final String hostname = configuration.lookup(alias).getHostName(); if(StringUtils.isBlank(hostname)) { return alias; } if(log.isInfoEnabled()) { log.info(String.format("Using hostname alias %s from %s", alias, configuration)); } return hostname; } OpenSSHHostnameConfigurator();  OpenSSHHostnameConfigurator(final OpenSshConfig configuration); @Override String getHostname(final String alias); @Override int getPort(final String alias); @Override void reload(); @Override String toString(); }
OpenSSHHostnameConfigurator implements HostnameConfigurator { @Override public String getHostname(final String alias) { if(StringUtils.isBlank(alias)) { return alias; } final String hostname = configuration.lookup(alias).getHostName(); if(StringUtils.isBlank(hostname)) { return alias; } if(log.isInfoEnabled()) { log.info(String.format("Using hostname alias %s from %s", alias, configuration)); } return hostname; } OpenSSHHostnameConfigurator();  OpenSSHHostnameConfigurator(final OpenSshConfig configuration); @Override String getHostname(final String alias); @Override int getPort(final String alias); @Override void reload(); @Override String toString();  }