
fitnesse.wiki.SystemVariableSource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fitnesse Show documentation
Show all versions of fitnesse Show documentation
The fully integrated standalone wiki, and acceptance testing framework.
The newest version!
package fitnesse.wiki;
import java.util.Optional;
import java.util.Properties;
import fitnesse.wikitext.VariableSource;
public class SystemVariableSource implements VariableSource {
private final Properties properties;
public SystemVariableSource(Properties properties) {
this.properties = properties;
}
public SystemVariableSource() {
this(null);
}
@Override
public Optional findVariable(String name) {
return Optional.ofNullable(getProperty(name));
}
public String getProperty(String name) {
String p = System.getenv(name);
if (p != null) return p;
p = System.getProperty(name);
if (p != null) return p;
return properties != null ? properties.getProperty(name) : null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy