Initialize settings from Properties

This commit is contained in:
Zlatin Balevsky
2018-07-23 16:08:30 +01:00
parent c0113dd738
commit afcc39ada9

View File

@@ -4,18 +4,35 @@ import com.muwire.core.hostcache.CrawlerResponse
class MuWireSettings {
MuWireSettings() {}
MuWireSettings(Properties props) {
isLeaf = Boolean.valueOf(props.get("leaf","false"))
allowUntrusted = Boolean.valueOf(props.get("allowUntrusted","true"))
crawlerResponse = CrawlerResponse.valueOf(props.get("crawlerResponse","REGISTERED"))
}
final boolean isLeaf
boolean allowUntrusted
CrawlerResponse crawlerResponse
boolean isLeaf() {
// TODO: implement
false
isLeaf
}
boolean allowUntrusted() {
// TODO: implement
true
allowUntrusted
}
void setAllowUntrusted(boolean allowUntrusted) {
this.allowUntrusted = allowUntrusted
}
CrawlerResponse getCrawlerResponse() {
// TODO: implement
CrawlerResponse.REGISTERED
crawlerResponse
}
void setCrawlerResponse(CrawlerResponse crawlerResponse) {
this.crawlerResponse = crawlerResponse
}
}