diff --git a/htroot/AccessPicture_p.java b/htroot/AccessPicture_p.java
index de5a64757..35a025622 100644
--- a/htroot/AccessPicture_p.java
+++ b/htroot/AccessPicture_p.java
@@ -65,7 +65,7 @@ public class AccessPicture_p {
color_grid = post.get("colorgrid", color_grid);
color_dot = post.get("colordot", color_dot);
color_line = post.get("colorline", color_line);
- corona = !post.containsKey("corona") || post.getBoolean("corona", false);
+ corona = !post.containsKey("corona") || post.getBoolean("corona");
coronaangle = (corona) ? post.getInt("coronaangle", 0) : -1;
}
if (coronaangle < 0) corona = false;
diff --git a/htroot/ConfigBasic.java b/htroot/ConfigBasic.java
index 14f7bbf61..ef545eb13 100644
--- a/htroot/ConfigBasic.java
+++ b/htroot/ConfigBasic.java
@@ -97,7 +97,7 @@ public class ConfigBasic {
boolean ssl;
if (post != null && post.getInt("port", 0) > 1023) {
port = post.getLong("port", 8090);
- ssl = post.getBoolean("withssl", false);
+ ssl = post.getBoolean("withssl");
} else {
port = env.getConfigLong("port", 8090); //this allows a low port, but it will only get one, if the user edits the config himself.
ssl = env.getConfigBool("server.https", false);
diff --git a/htroot/ConfigPortal.java b/htroot/ConfigPortal.java
index 1fa1f80d8..561ada482 100644
--- a/htroot/ConfigPortal.java
+++ b/htroot/ConfigPortal.java
@@ -83,15 +83,15 @@ public class ConfigPortal {
sb.setConfig(SwitchboardConstants.SEARCH_ITEMS, post.getInt("maximumRecords", 10));
sb.setConfig(SwitchboardConstants.INDEX_FORWARD, post.get(SwitchboardConstants.INDEX_FORWARD, ""));
HTTPDFileHandler.indexForward = post.get(SwitchboardConstants.INDEX_FORWARD, "");
- sb.setConfig("publicTopmenu", !post.containsKey("publicTopmenu") || post.getBoolean("publicTopmenu", true));
- sb.setConfig("publicSearchpage", !post.containsKey("publicSearchpage") || post.getBoolean("publicSearchpage", true));
- sb.setConfig("search.options", post.getBoolean("search.options", false));
+ sb.setConfig("publicTopmenu", !post.containsKey("publicTopmenu") || post.getBoolean("publicTopmenu"));
+ sb.setConfig("publicSearchpage", !post.containsKey("publicSearchpage") || post.getBoolean("publicSearchpage"));
+ sb.setConfig("search.options", post.getBoolean("search.options"));
- sb.setConfig("interaction.userlogon.enabled", post.getBoolean("interaction.userlogon", false));
- sb.setConfig(SwitchboardConstants.GREEDYLEARNING_ACTIVE, post.getBoolean(SwitchboardConstants.GREEDYLEARNING_ACTIVE, true));
+ sb.setConfig("interaction.userlogon.enabled", post.getBoolean("interaction.userlogon"));
+ sb.setConfig(SwitchboardConstants.GREEDYLEARNING_ACTIVE, post.getBoolean(SwitchboardConstants.GREEDYLEARNING_ACTIVE));
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, post.get("search.verify", "ifexist"));
- sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, post.getBoolean("search.verify.delete", false));
+ sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, post.getBoolean("search.verify.delete"));
sb.setConfig("about.headline", post.get("about.headline", ""));
sb.setConfig("about.body", post.get("about.body", ""));
diff --git a/htroot/ConfigSearchPage_p.java b/htroot/ConfigSearchPage_p.java
index 94663e7a0..108845e35 100644
--- a/htroot/ConfigSearchPage_p.java
+++ b/htroot/ConfigSearchPage_p.java
@@ -59,34 +59,34 @@ public class ConfigSearchPage_p {
// store this call as api call
sb.tables.recordAPICall(post, "ConfigPortal.html", WorkTables.TABLE_API_TYPE_CONFIGURATION, "new portal design. greeting: " + newGreeting);
- sb.setConfig("publicTopmenu", post.getBoolean("publicTopmenu", false));
- sb.setConfig("search.options", post.getBoolean("search.options", false));
+ sb.setConfig("publicTopmenu", post.getBoolean("publicTopmenu"));
+ sb.setConfig("search.options", post.getBoolean("search.options"));
- sb.setConfig("search.text", post.getBoolean("search.text", false));
- sb.setConfig("search.image", post.getBoolean("search.image", false));
- sb.setConfig("search.audio", post.getBoolean("search.audio", false));
- sb.setConfig("search.video", post.getBoolean("search.video", false));
- sb.setConfig("search.app", post.getBoolean("search.app", false));
+ sb.setConfig("search.text", post.getBoolean("search.text"));
+ sb.setConfig("search.image", post.getBoolean("search.image"));
+ sb.setConfig("search.audio", post.getBoolean("search.audio"));
+ sb.setConfig("search.video", post.getBoolean("search.video"));
+ sb.setConfig("search.app", post.getBoolean("search.app"));
- sb.setConfig("search.result.show.date", post.getBoolean("search.result.show.date", false));
- sb.setConfig("search.result.show.size", post.getBoolean("search.result.show.size", false));
- sb.setConfig("search.result.show.metadata", post.getBoolean("search.result.show.metadata", false));
- sb.setConfig("search.result.show.parser", post.getBoolean("search.result.show.parser", false));
- sb.setConfig("search.result.show.citation", post.getBoolean("search.result.show.citation", false));
- sb.setConfig("search.result.show.pictures", post.getBoolean("search.result.show.pictures", false));
- sb.setConfig("search.result.show.cache", post.getBoolean("search.result.show.cache", false));
- sb.setConfig("search.result.show.proxy", post.getBoolean("search.result.show.proxy", false));
- sb.setConfig("search.result.show.hostbrowser", post.getBoolean("search.result.show.hostbrowser", false));
- sb.setConfig("search.result.show.tags", post.getBoolean("search.result.show.tags", false));
+ sb.setConfig("search.result.show.date", post.getBoolean("search.result.show.date"));
+ sb.setConfig("search.result.show.size", post.getBoolean("search.result.show.size"));
+ sb.setConfig("search.result.show.metadata", post.getBoolean("search.result.show.metadata"));
+ sb.setConfig("search.result.show.parser", post.getBoolean("search.result.show.parser"));
+ sb.setConfig("search.result.show.citation", post.getBoolean("search.result.show.citation"));
+ sb.setConfig("search.result.show.pictures", post.getBoolean("search.result.show.pictures"));
+ sb.setConfig("search.result.show.cache", post.getBoolean("search.result.show.cache"));
+ sb.setConfig("search.result.show.proxy", post.getBoolean("search.result.show.proxy"));
+ sb.setConfig("search.result.show.hostbrowser", post.getBoolean("search.result.show.hostbrowser"));
+ sb.setConfig("search.result.show.tags", post.getBoolean("search.result.show.tags"));
// construct navigation String
String nav = "";
- if (post.getBoolean("search.navigation.filetype", false)) nav += "filetype,";
- if (post.getBoolean("search.navigation.protocol", false)) nav += "protocol,";
- if (post.getBoolean("search.navigation.hosts", false)) nav += "hosts,";
- if (post.getBoolean("search.navigation.authors", false)) nav += "authors,";
- if (post.getBoolean("search.navigation.namespace", false)) nav += "namespace,";
- if (post.getBoolean("search.navigation.topics", false)) nav += "topics,";
+ if (post.getBoolean("search.navigation.filetype")) nav += "filetype,";
+ if (post.getBoolean("search.navigation.protocol")) nav += "protocol,";
+ if (post.getBoolean("search.navigation.hosts")) nav += "hosts,";
+ if (post.getBoolean("search.navigation.authors")) nav += "authors,";
+ if (post.getBoolean("search.navigation.namespace")) nav += "namespace,";
+ if (post.getBoolean("search.navigation.topics")) nav += "topics,";
if (nav.endsWith(",")) nav = nav.substring(0, nav.length() - 1);
sb.setConfig("search.navigation", nav);
}
diff --git a/htroot/ConfigUpdate_p.java b/htroot/ConfigUpdate_p.java
index 4e8877745..71bcdd7d5 100644
--- a/htroot/ConfigUpdate_p.java
+++ b/htroot/ConfigUpdate_p.java
@@ -157,7 +157,7 @@ public class ConfigUpdate_p {
sb.setConfig("update.cycle", Math.max(12, post.getLong("cycle", 168)));
sb.setConfig("update.blacklist", post.get("blacklist", ""));
sb.setConfig("update.concept", ("any".equals(post.get("releaseType", "any"))) ? "any" : "main");
- sb.setConfig("update.onlySignedFiles", (post.getBoolean("onlySignedFiles", true)) ? "1" : "0");
+ sb.setConfig("update.onlySignedFiles", (post.getBoolean("onlySignedFiles")) ? "1" : "0");
}
}
diff --git a/htroot/Connections_p.java b/htroot/Connections_p.java
index 8134f53ab..efcf017df 100644
--- a/htroot/Connections_p.java
+++ b/htroot/Connections_p.java
@@ -61,7 +61,7 @@ public final class Connections_p {
// determines if name lookup should be done or not
final boolean doNameLookup;
if (post != null) {
- doNameLookup = post.getBoolean("nameLookup", false);
+ doNameLookup = post.getBoolean("nameLookup");
if (post.containsKey("closeServerSession")) {
final String sessionName = post.get("closeServerSession", null);
sb.closeSessions(sessionName);
diff --git a/htroot/Crawler_p.java b/htroot/Crawler_p.java
index 915913286..1cd75ef15 100644
--- a/htroot/Crawler_p.java
+++ b/htroot/Crawler_p.java
@@ -171,7 +171,7 @@ public class Crawler_p {
long t = timeParser(true, post.getInt("deleteIfOlderNumber", -1), post.get("deleteIfOlderUnit","year")); // year, month, day, hour
if (t > 0) deleteageDate = new Date(t);
}
- final boolean deleteold = (deleteage && deleteageDate != null) || (restrictedcrawl && post.getBoolean("deleteold", false));
+ final boolean deleteold = (deleteage && deleteageDate != null) || (restrictedcrawl && post.getBoolean("deleteold"));
String crawlingStart0 = post.get("crawlingURL","").trim(); // the crawljob start url
String[] rootURLs0 = crawlingStart0.indexOf('\n') > 0 || crawlingStart0.indexOf('\r') > 0 ? crawlingStart0.split("[\\r\\n]+") : crawlingStart0.split(Pattern.quote("|"));
@@ -207,7 +207,7 @@ public class Crawler_p {
String ipMustMatch = post.get("ipMustmatch", CrawlProfile.MATCH_ALL_STRING);
final String ipMustNotMatch = post.get("ipMustnotmatch", CrawlProfile.MATCH_NEVER_STRING);
if (ipMustMatch.length() < 2) ipMustMatch = CrawlProfile.MATCH_ALL_STRING;
- final String countryMustMatch = post.getBoolean("countryMustMatchSwitch", false) ? post.get("countryMustMatchList", "") : "";
+ final String countryMustMatch = post.getBoolean("countryMustMatchSwitch") ? post.get("countryMustMatchList", "") : "";
sb.setConfig("crawlingIPMustMatch", ipMustMatch);
sb.setConfig("crawlingIPMustNotMatch", ipMustNotMatch);
if (countryMustMatch.length() > 0) sb.setConfig("crawlingCountryMustMatch", countryMustMatch);
diff --git a/htroot/HostBrowser.java b/htroot/HostBrowser.java
index aa5a63404..7cfdc8a52 100644
--- a/htroot/HostBrowser.java
+++ b/htroot/HostBrowser.java
@@ -228,7 +228,7 @@ public class HostBrowser {
delete = true;
}
int facetcount=post.getInt("facetcount", 0);
- boolean complete = post.getBoolean("complete", false);
+ boolean complete = post.getBoolean("complete");
if (complete) { // we want only root paths for complete lists
p = path.indexOf('/', 10);
if (p > 0) path = path.substring(0, p + 1);
diff --git a/htroot/IndexFederated_p.html b/htroot/IndexFederated_p.html
index 0c6b31654..e5524a8e6 100644
--- a/htroot/IndexFederated_p.html
+++ b/htroot/IndexFederated_p.html
@@ -21,12 +21,12 @@
Solr stores the main search index. It is the home of two cores, the default 'collection1' core for documents and the 'webgraph' core for a web structure graph. Detailed information about the used Solr fields can be edited in the Schema Editor .
-
- Lazy Value Initialization. If checked, only non-zero values and non-empty strings are written to Solr fields.
+ Lazy Value Initialization
+ If checked, only non-zero values and non-empty strings are written to Solr fields.
- Use deep-embedded local Solr
-
+ Use deep-embedded local Solr
+
This will write the YaCy-embedded Solr index which stored within the YaCy DATA directory.
The Solr native search interface is accessible at
/solr/select?q=*:*&start=0&rows=3&core=collection1
@@ -34,12 +34,10 @@
/solr/select?q=*:*&start=0&rows=3&core=webgraph for the webgraph core.
If you switch off this index, a remote Solr must be activated.
-
- Use remote Solr server(s)
-
- Here you can define a single or a set of remote solr servers. If both, an internal and an external Solr is used, then both are mirrored.
- That means, every write request goes to internal and external Solr, but a read request goes only to the internal index.
- Only if the internal index does not give any result on a search request, also the remote is requested.
+ Use remote Solr server(s)
+ It's easy to attach an external Solr to YaCy .
+ This external Solr can be used instead the internal Solr. It can also be used additionally to the internal Solr, then both Solr indexes are mirrored.
+
#(table)#::
@@ -70,34 +68,14 @@
Sharding Method
-
-
- An external Solr installation is easily done following these steps (by example for Solr 4.1.0):
-
- Download solr-4.1.0.tgz from http://lucene.apache.org/solr/
- Decompress solr-4.1.0.tgz (with 'tar xfz solr-4.1.0.tgz') and put solr-4.1.0 into ~/
- Consider that YaCy is already running and stored in ~/yacy/
- To configure the multi-core configuration of YaCy, execute:
- mkdir ~/solr-4.1.0/example/solr/webgraph
-cp -R ~/solr-4.1.0/example/solr/collection1/conf ~/solr-4.1.0/example/solr/webgraph/conf
-~/yacy/bin/apicat.sh /api/schema.xml?core=collection1 > ~/solr-4.1.0/example/solr/collection1/conf/schema.xml
-~/yacy/bin/apicat.sh /api/schema.xml?core=webgraph > ~/solr-4.1.0/example/solr/webgraph/conf/schema.xml
- edit ~/solr-4.1.0/example/solr/solr.xml and put in the following content:
- <?xml version="1.0" encoding="UTF-8" ?>
-<solr persistent="true">
- <cores adminPath="/admin/cores" defaultCoreName="collection1">
- <core name="collection1" instanceDir="collection1" />
- <core name="webgraph" instanceDir="webgraph" />
- </cores>
-</solr>
- Finally, start the external Solr with:
- cd ~/solr-4.1.0/example/ && java -jar start.jar
- open http://localhost:8983/solr/ to visit Solr's administration console.
-
+
+
-
+
+
+
+
diff --git a/htroot/IndexFederated_p.java b/htroot/IndexFederated_p.java
index 6008cd4ec..86f2928d3 100644
--- a/htroot/IndexFederated_p.java
+++ b/htroot/IndexFederated_p.java
@@ -46,9 +46,9 @@ public class IndexFederated_p {
final serverObjects prop = new serverObjects();
final Switchboard sb = (Switchboard) env;
- if (post != null && post.containsKey("set")) {
+ if (post != null && post.containsKey("setrwi")) {
//yacy
- boolean post_core_rwi = post.getBoolean(SwitchboardConstants.CORE_SERVICE_RWI, false);
+ boolean post_core_rwi = post.getBoolean(SwitchboardConstants.CORE_SERVICE_RWI);
final boolean previous_core_rwi = sb.index.connectedRWI() && env.getConfigBool(SwitchboardConstants.CORE_SERVICE_RWI, false);
env.setConfig(SwitchboardConstants.CORE_SERVICE_RWI, post_core_rwi);
if (previous_core_rwi && !post_core_rwi) sb.index.disconnectRWI(); // switch off
@@ -57,8 +57,10 @@ public class IndexFederated_p {
final long fileSizeMax = (OS.isWindows) ? sb.getConfigLong("filesize.max.win", Integer.MAX_VALUE) : sb.getConfigLong( "filesize.max.other", Integer.MAX_VALUE);
sb.index.connectRWI(wordCacheMaxCount, fileSizeMax);
} catch (final IOException e) { ConcurrentLog.logException(e); } // switch on
+ }
- boolean post_core_citation = post.getBoolean(SwitchboardConstants.CORE_SERVICE_CITATION, false);
+ if (post != null && post.containsKey("setcitation")) {
+ boolean post_core_citation = post.getBoolean(SwitchboardConstants.CORE_SERVICE_CITATION);
final boolean previous_core_citation = sb.index.connectedCitation() && env.getConfigBool(SwitchboardConstants.CORE_SERVICE_CITATION, false);
env.setConfig(SwitchboardConstants.CORE_SERVICE_CITATION, post_core_citation);
if (previous_core_citation && !post_core_citation) sb.index.disconnectCitation(); // switch off
@@ -67,8 +69,18 @@ public class IndexFederated_p {
final long fileSizeMax = (OS.isWindows) ? sb.getConfigLong("filesize.max.win", Integer.MAX_VALUE) : sb.getConfigLong( "filesize.max.other", Integer.MAX_VALUE);
sb.index.connectCitation(wordCacheMaxCount, fileSizeMax);
} catch (final IOException e) { ConcurrentLog.logException(e); } // switch on
+ boolean webgraph = post.getBoolean(SwitchboardConstants.CORE_SERVICE_WEBGRAPH);
+ sb.index.fulltext().writeWebgraph(webgraph);
+ env.setConfig(SwitchboardConstants.CORE_SERVICE_WEBGRAPH, webgraph);
+ }
- boolean post_core_fulltext = post.getBoolean(SwitchboardConstants.CORE_SERVICE_FULLTEXT, true);
+ if (post != null && post.containsKey("setjena")) {
+ boolean jena = post.getBoolean(SwitchboardConstants.CORE_SERVICE_JENA);
+ env.setConfig(SwitchboardConstants.CORE_SERVICE_JENA, jena);
+ }
+
+ if (post != null && post.containsKey("setsolr")) {
+ boolean post_core_fulltext = post.getBoolean(SwitchboardConstants.CORE_SERVICE_FULLTEXT);
final boolean previous_core_fulltext = sb.index.fulltext().connectedLocalSolr() && env.getConfigBool(SwitchboardConstants.CORE_SERVICE_FULLTEXT, false);
env.setConfig(SwitchboardConstants.CORE_SERVICE_FULLTEXT, post_core_fulltext);
@@ -82,18 +94,11 @@ public class IndexFederated_p {
sb.index.connectUrlDb(sb.useTailCache, sb.exceed134217727);
try { sb.index.fulltext().connectLocalSolr(); } catch (final IOException e) { ConcurrentLog.logException(e); }
}
-
- boolean webgraph = post.getBoolean(SwitchboardConstants.CORE_SERVICE_WEBGRAPH, false);
- sb.index.fulltext().writeWebgraph(webgraph);
- env.setConfig(SwitchboardConstants.CORE_SERVICE_WEBGRAPH, webgraph);
-
- boolean jena = post.getBoolean(SwitchboardConstants.CORE_SERVICE_JENA, false);
- env.setConfig(SwitchboardConstants.CORE_SERVICE_JENA, jena);
// solr
final boolean solrRemoteWasOn = sb.index.fulltext().connectedRemoteSolr() && env.getConfigBool(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_ENABLED, true);
String solrurls = post.get("solr.indexing.url", env.getConfig(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_URL, "http://127.0.0.1:8983/solr"));
- final boolean solrRemoteIsOnAfterwards = post.getBoolean("solr.indexing.solrremote", false) & solrurls.length() > 0;
+ final boolean solrRemoteIsOnAfterwards = post.getBoolean("solr.indexing.solrremote") & solrurls.length() > 0;
env.setConfig(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_ENABLED, solrRemoteIsOnAfterwards);
final BufferedReader r = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(UTF8.getBytes(solrurls))));
final StringBuilder s = new StringBuilder();
@@ -148,7 +153,7 @@ public class IndexFederated_p {
ConcurrentLog.severe("IndexFederated_p", "change of solr connection failed", e);
}
- boolean lazy = post.getBoolean("solr.indexing.lazy", true);
+ boolean lazy = post.getBoolean("solr.indexing.lazy");
env.setConfig(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_LAZY, lazy);
}
diff --git a/htroot/NetworkPicture.java b/htroot/NetworkPicture.java
index b57bd2787..a48e7356d 100644
--- a/htroot/NetworkPicture.java
+++ b/htroot/NetworkPicture.java
@@ -90,7 +90,7 @@ public class NetworkPicture
passiveLimit = post.getInt("pal", passiveLimit);
potentialLimit = post.getInt("pol", potentialLimit);
maxCount = post.getInt("max", maxCount);
- corona = post.getBoolean("corona", true);
+ corona = post.getBoolean("corona");
coronaangle = (corona) ? post.getInt("coronaangle", 0) : -1;
communicationTimeout = post.getLong("ct", -1);
bgcolor = post.get("bgcolor", bgcolor);
diff --git a/htroot/PeerLoadPicture.java b/htroot/PeerLoadPicture.java
index 2b8d46dcf..3482279cf 100644
--- a/htroot/PeerLoadPicture.java
+++ b/htroot/PeerLoadPicture.java
@@ -22,7 +22,7 @@ public class PeerLoadPicture {
if (post != null) {
width = post.getInt("width", 800);
height = post.getInt("height", 600);
- showidle = post.getBoolean("showidle", false);
+ showidle = post.getBoolean("showidle");
}
final CircleThreadPiece idle = new CircleThreadPiece("Idle", new Color(170, 255, 170));
diff --git a/htroot/Status.java b/htroot/Status.java
index 0e1198e51..3a4622674 100644
--- a/htroot/Status.java
+++ b/htroot/Status.java
@@ -102,11 +102,11 @@ public class Status
ByteCount.resetCount();
redirect = true;
} else if ( post.containsKey("popup") ) {
- final boolean trigger_enabled = post.getBoolean("popup", false);
+ final boolean trigger_enabled = post.getBoolean("popup");
sb.setConfig("browserPopUpTrigger", trigger_enabled);
redirect = true;
} else if ( post.containsKey("tray") ) {
- final boolean trigger_enabled = post.getBoolean("tray", false);
+ final boolean trigger_enabled = post.getBoolean("tray");
sb.setConfig("trayIcon", trigger_enabled);
redirect = true;
}
diff --git a/htroot/Table_API_p.java b/htroot/Table_API_p.java
index 4c854a1d0..6b3689343 100644
--- a/htroot/Table_API_p.java
+++ b/htroot/Table_API_p.java
@@ -65,7 +65,7 @@ public class Table_API_p {
startRecord = 0;
maximumRecords = 1000;
}
- final boolean inline = (post != null && post.getBoolean("inline", false));
+ final boolean inline = (post != null && post.getBoolean("inline"));
prop.put("inline", (inline) ? 1 : 0);
diff --git a/htroot/Threaddump_p.java b/htroot/Threaddump_p.java
index c54a5ccfc..c60ef6d0f 100644
--- a/htroot/Threaddump_p.java
+++ b/htroot/Threaddump_p.java
@@ -49,7 +49,7 @@ public class Threaddump_p {
final StringBuilder buffer = new StringBuilder(1000);
- final boolean plain = post != null && post.getBoolean("plain", false);
+ final boolean plain = post != null && post.getBoolean("plain");
final int sleep = (post == null) ? 0 : post.getInt("sleep", 0); // a sleep before creation of a thread dump can be used for profiling
if (sleep > 0) try {Thread.sleep(sleep);} catch (final InterruptedException e) {}
prop.put("dump", "1");
diff --git a/htroot/ViewFile.java b/htroot/ViewFile.java
index 40be24cfe..5482bac56 100644
--- a/htroot/ViewFile.java
+++ b/htroot/ViewFile.java
@@ -129,7 +129,7 @@ public class ViewFile {
// define an url by post parameter
url = new DigestURI(MultiProtocolURI.unescape(urlString));
urlHash = ASCII.String(url.hash());
- pre = post.getBoolean("pre", false);
+ pre = post.getBoolean("pre");
} catch (final MalformedURLException e) {}
URIMetadataNode urlEntry = null;
diff --git a/htroot/api/ymarks/import_ymark.java b/htroot/api/ymarks/import_ymark.java
index e4c890c94..daceeefb4 100644
--- a/htroot/api/ymarks/import_ymark.java
+++ b/htroot/api/ymarks/import_ymark.java
@@ -62,7 +62,7 @@ public class import_ymark {
boolean merge = false;
boolean empty = false;
final String indexing = post.get("indexing", "off");
- final boolean medialink = post.getBoolean("medialink", false);
+ final boolean medialink = post.getBoolean("medialink");
if(post.containsKey("autotag") && !post.get("autotag", "off").equals("off")) {
autotag = true;
diff --git a/htroot/opensearchdescription.java b/htroot/opensearchdescription.java
index af08b6dfd..4e7bef9d1 100644
--- a/htroot/opensearchdescription.java
+++ b/htroot/opensearchdescription.java
@@ -44,7 +44,7 @@ public class opensearchdescription {
if (thisaddress.indexOf(':',0) == -1) thisaddress += ":" + serverCore.getPortNr(env.getConfig("port", "8090"));
int compareyacy = 0;
- if (post != null && post.getBoolean("compare_yacy", false)) compareyacy = 1;
+ if (post != null && post.getBoolean("compare_yacy")) compareyacy = 1;
final serverObjects prop = new serverObjects();
prop.put("compareyacy", compareyacy);
diff --git a/source/net/yacy/server/serverObjects.java b/source/net/yacy/server/serverObjects.java
index ee70108e0..f844d8f28 100644
--- a/source/net/yacy/server/serverObjects.java
+++ b/source/net/yacy/server/serverObjects.java
@@ -445,9 +445,18 @@ public class serverObjects implements Serializable, Cloneable {
}
}
- public boolean getBoolean(final String key, final boolean dflt) {
+ /**
+ * get the boolean value of a post field
+ * DO NOT INTRODUCE A DEFAULT FIELD HERE,
+ * this is an application for html checkboxes which do not appear
+ * in the post if they are not selected.
+ * Therefore the default value MUST be always FALSE.
+ * @param key
+ * @return the boolean value of a field or false, if the field does not appear.
+ */
+ public boolean getBoolean(final String key) {
String s = removeByteOrderMark(get(key));
- if (s == null) return dflt;
+ if (s == null) return false;
s = s.toLowerCase();
return s.equals("true") || s.equals("on") || s.equals("1");
}