*) Moving yacyDebugMode intialization to switchboard

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@660 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 19 years ago
parent ebc39a7b9a
commit 6c722706b7

@ -131,7 +131,7 @@ public final class httpc {
private String requestPath = null;
private boolean allowContentEncoding = true;
static boolean useYacyReferer = true;
static boolean yacyDebugMode = false;
public static boolean yacyDebugMode = false;
static {
// set time-out of InetAddress.getByName cache ttl

@ -199,7 +199,6 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
// doing httpc init
httpc.useYacyReferer = sb.getConfig("useYacyReferer", "true").equals("true");
httpc.yacyDebugMode = sb.getConfig("yacyDebugMode", "false").equals("true");
// load remote proxy data
remoteProxyHost = switchboard.getConfig("remoteProxyHost","");

@ -97,6 +97,10 @@ public class plasmaParserDocument {
}
}
public String getMimeType() {
return this.mimeType;
}
public String getMainShortTitle() {
if (shortTitle != null) return shortTitle; else return longTitle;
}

@ -118,6 +118,7 @@ import de.anomic.data.messageBoard;
import de.anomic.data.wikiBoard;
import de.anomic.htmlFilter.htmlFilterContentScraper;
import de.anomic.http.httpHeader;
import de.anomic.http.httpc;
import de.anomic.http.httpd;
import de.anomic.kelondro.kelondroException;
import de.anomic.kelondro.kelondroMSetTools;
@ -192,6 +193,8 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
// load values from configs
plasmaPath = new File(rootPath, getConfig("dbPath", "PLASMADB"));
listsPath = new File(rootPath, getConfig("listsPath", "LISTS"));
// remote proxy configuration
remoteProxyHost = getConfig("remoteProxyHost", "");
try {
remoteProxyPort = Integer.parseInt(getConfig("remoteProxyPort", "3128"));
@ -200,6 +203,9 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
}
if (getConfig("remoteProxyUse", "false").equals("true")) {
remoteProxyUse = true;
log.logConfig("Using remote proxy:" +
"\n\tHost: " + remoteProxyHost +
"\n\tPort: " + remoteProxyPort);
} else {
remoteProxyUse = false;
remoteProxyHost = null;
@ -214,6 +220,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
// read only once upon first instantiation of this class
String f = getConfig("plasmaBlueList", null);
if (f != null) blueList = kelondroMSetTools.loadList(new File(f)); else blueList= new TreeSet();
this.log.logConfig("loaded blue-list from file " + f + ", " + blueList.size() + " entries");
}
// load the black-list / inspired by [AS]
@ -221,13 +228,14 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
String f = getConfig("proxyBlackListsActive", null);
if (f != null) {
urlBlacklist.loadLists("black", f, "/");
log.logConfig("loaded black-list from file " + f + ", " + urlBlacklist.size() + " entries");
this.log.logConfig("loaded black-list from file " + f + ", " + urlBlacklist.size() + " entries");
}
log.logConfig("Proxy Handler Initialized");
// load stopwords
if (stopwords == null) {
stopwords = kelondroMSetTools.loadList(new File(rootPath, "yacy.stopwords"));
File stopwordsFile = new File(rootPath, "yacy.stopwords");
stopwords = kelondroMSetTools.loadList(stopwordsFile);
this.log.logConfig("loaded stopwords from file " + stopwordsFile + ", " + stopwords.size() + " entries");
}
// read memory amount
@ -238,18 +246,20 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
int ramHTTP = Integer.parseInt(getConfig("ramCacheHTTP", "1024")) / 1024;
int ramMessage = Integer.parseInt(getConfig("ramCacheMessage", "1024")) / 1024;
int ramWiki = Integer.parseInt(getConfig("ramCacheWiki", "1024")) / 1024;
log.logConfig("LURL Cache memory = " + ppRamString(ramLURL));
log.logConfig("NURL Cache memory = " + ppRamString(ramNURL));
log.logConfig("EURL Cache memory = " + ppRamString(ramEURL));
log.logConfig("RWI Cache memory = " + ppRamString(ramRWI));
log.logConfig("HTTP Cache memory = " + ppRamString(ramHTTP));
log.logConfig("Message Cache memory = " + ppRamString(ramMessage));
log.logConfig("Wiki Cache memory = " + ppRamString(ramWiki));
this.log.logConfig("LURL Cache memory = " + ppRamString(ramLURL));
this.log.logConfig("NURL Cache memory = " + ppRamString(ramNURL));
this.log.logConfig("EURL Cache memory = " + ppRamString(ramEURL));
this.log.logConfig("RWI Cache memory = " + ppRamString(ramRWI));
this.log.logConfig("HTTP Cache memory = " + ppRamString(ramHTTP));
this.log.logConfig("Message Cache memory = " + ppRamString(ramMessage));
this.log.logConfig("Wiki Cache memory = " + ppRamString(ramWiki));
// make crawl profiles database and default profiles
log.logConfig("Initializing Crawl Profiles");
profiles = new plasmaCrawlProfile(new File(plasmaPath, "crawlProfiles0.db"));
this.log.logConfig("Initializing Crawl Profiles");
File profilesFile = new File(this.plasmaPath, "crawlProfiles0.db");
this.profiles = new plasmaCrawlProfile(new File(this.plasmaPath, "crawlProfiles0.db"));
initProfiles();
log.logConfig("Loaded profiles from file " + profilesFile + ", " + this.profiles.size() + " entries");
// start indexing management
log.logConfig("Starting Indexing Management");
@ -343,6 +353,9 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
testresult = facilityDB.selectLong("statistik", (new serverDate()).toShortString(false).substring(0, 11));
*/
// initializing yacyDebugMode
httpc.yacyDebugMode = sb.getConfig("yacyDebugMode", "false").equals("true");
// generate snippets cache
log.logConfig("Initializing Snippet Cache");
snippetCache = new plasmaSnippetCache(cacheManager, parser,

Loading…
Cancel
Save