![JAR search and dependency download from the Maven repository](/logo.png)
com.nitorcreations.willow.servers.SimpleHostLookupService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of willow-servers Show documentation
Show all versions of willow-servers Show documentation
Willow operational servlets and servers
The newest version!
package com.nitorcreations.willow.servers;
public class SimpleHostLookupService implements HostLookupService {
private String domainName;
public SimpleHostLookupService() {
}
public SimpleHostLookupService(String domainName) {
while (domainName.startsWith(".")) {
domainName = domainName.substring(1);
}
this.domainName = domainName;
}
@Override
public String getAdminUserFor(String tagHost) {
return System.getProperty("user.name");
}
@Override
public String getResolvableHostname(String tagHost) {
if (domainName == null || domainName.isEmpty()) {
return tagHost;
} else {
return tagHost + "." + domainName;
}
}
public String getDomainName() {
return domainName;
}
public void setDomainName(String domainName) {
while (domainName.startsWith(".")) {
domainName = domainName.substring(1);
}
this.domainName = domainName;
}
@Override
public int getSshPort(String host) {
return 22;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy