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

@@ -3,19 +3,36 @@ package com.muwire.core
import com.muwire.core.hostcache.CrawlerResponse import com.muwire.core.hostcache.CrawlerResponse
class MuWireSettings { 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() { boolean isLeaf() {
// TODO: implement isLeaf
false
} }
boolean allowUntrusted() { boolean allowUntrusted() {
// TODO: implement allowUntrusted
true
} }
void setAllowUntrusted(boolean allowUntrusted) {
this.allowUntrusted = allowUntrusted
}
CrawlerResponse getCrawlerResponse() { CrawlerResponse getCrawlerResponse() {
// TODO: implement crawlerResponse
CrawlerResponse.REGISTERED }
void setCrawlerResponse(CrawlerResponse crawlerResponse) {
this.crawlerResponse = crawlerResponse
} }
} }