*)cleanup access static methods and fields

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1016 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
hydrox 20 years ago
parent 56b9f34411
commit cb69047b91

@ -70,7 +70,6 @@ public class IndexCreateIndexingQueue_p {
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
// return variable that accumulates replacements
plasmaSwitchboard switchboard = (plasmaSwitchboard) env;
wikiCode wikiTransformer = new wikiCode(switchboard);
serverObjects prop = new serverObjects();
prop.put("rejected", 0);
int showRejectedCount = 10;
@ -149,11 +148,11 @@ public class IndexCreateIndexingQueue_p {
if ((pcentry != null)&&(pcentry.url() != null)) {
initiator = yacyCore.seedDB.getConnected(pcentry.initiator());
prop.put("indexing-queue_list_"+entryCount+"_dark", (inProcess)? 2: ((dark) ? 1 : 0));
prop.put("indexing-queue_list_"+entryCount+"_initiator", ((initiator == null) ? "proxy" : wikiTransformer.replaceHTML(initiator.getName())));
prop.put("indexing-queue_list_"+entryCount+"_initiator", ((initiator == null) ? "proxy" : wikiCode.replaceHTML(initiator.getName())));
prop.put("indexing-queue_list_"+entryCount+"_depth", pcentry.depth());
prop.put("indexing-queue_list_"+entryCount+"_modified", (pcentry.responseHeader() == null) ? "" : daydate(pcentry.responseHeader().lastModified()));
prop.put("indexing-queue_list_"+entryCount+"_anchor", (pcentry.anchorName()==null)?"":pcentry.anchorName());
prop.put("indexing-queue_list_"+entryCount+"_url", wikiTransformer.replaceHTML(pcentry.normalizedURLString()));
prop.put("indexing-queue_list_"+entryCount+"_url", wikiCode.replaceHTML(pcentry.normalizedURLString()));
prop.put("indexing-queue_list_"+entryCount+"_size", bytesToString(entrySize));
prop.put("indexing-queue_list_"+entryCount+"_inProcess", (inProcess)?1:0);
prop.put("indexing-queue_list_"+entryCount+"_inProcess_hash", pcentry.urlHash());
@ -192,9 +191,9 @@ public class IndexCreateIndexingQueue_p {
url = entry.url().toString();
initiatorSeed = yacyCore.seedDB.getConnected(initiatorHash);
executorSeed = yacyCore.seedDB.getConnected(executorHash);
prop.put("rejected_list_"+j+"_initiator", ((initiatorSeed == null) ? "proxy" : wikiTransformer.replaceHTML(initiatorSeed.getName())));
prop.put("rejected_list_"+j+"_executor", ((executorSeed == null) ? "proxy" : wikiTransformer.replaceHTML(executorSeed.getName())));
prop.put("rejected_list_"+j+"_url", wikiTransformer.replaceHTML(url));
prop.put("rejected_list_"+j+"_initiator", ((initiatorSeed == null) ? "proxy" : wikiCode.replaceHTML(initiatorSeed.getName())));
prop.put("rejected_list_"+j+"_executor", ((executorSeed == null) ? "proxy" : wikiCode.replaceHTML(executorSeed.getName())));
prop.put("rejected_list_"+j+"_url", wikiCode.replaceHTML(url));
prop.put("rejected_list_"+j+"_failreason", entry.failreason());
prop.put("rejected_list_"+j+"_dark", ((dark) ? 1 : 0));
dark = !dark;

@ -67,7 +67,6 @@ public class IndexCreateLoaderQueue_p {
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
// return variable that accumulates replacements
plasmaSwitchboard switchboard = (plasmaSwitchboard) env;
wikiCode wikiTransformer = new wikiCode(switchboard);
serverObjects prop = new serverObjects();
@ -90,9 +89,9 @@ public class IndexCreateLoaderQueue_p {
initiator = yacyCore.seedDB.getConnected(theMsg.initiator);
prop.put("loader-set_list_"+count+"_dark", ((dark) ? 1 : 0) );
prop.put("loader-set_list_"+count+"_initiator", ((initiator == null) ? "proxy" : wikiTransformer.replaceHTML(initiator.getName())) );
prop.put("loader-set_list_"+count+"_initiator", ((initiator == null) ? "proxy" : wikiCode.replaceHTML(initiator.getName())) );
prop.put("loader-set_list_"+count+"_depth", theMsg.depth );
prop.put("loader-set_list_"+count+"_url", wikiTransformer.replaceHTML(theMsg.url.toString())); // null pointer exception here !!! maybe url = null; check reason.
prop.put("loader-set_list_"+count+"_url", wikiCode.replaceHTML(theMsg.url.toString())); // null pointer exception here !!! maybe url = null; check reason.
dark = !dark;
count++;
}

@ -67,7 +67,6 @@ public class IndexCreateWWWGlobalQueue_p {
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
// return variable that accumulates replacements
plasmaSwitchboard switchboard = (plasmaSwitchboard) env;
wikiCode wikiTransformer = new wikiCode(switchboard);
serverObjects prop = new serverObjects();
if (post != null) {
@ -109,12 +108,12 @@ public class IndexCreateWWWGlobalQueue_p {
profileHandle = urle.profileHandle();
profileEntry = (profileHandle == null) ? null : switchboard.profiles.getEntry(profileHandle);
prop.put("crawler-queue_list_"+i+"_dark", ((dark) ? 1 : 0) );
prop.put("crawler-queue_list_"+i+"_initiator", ((initiator == null) ? "proxy" : wikiTransformer.replaceHTML(initiator.getName())) );
prop.put("crawler-queue_list_"+i+"_profile", ((profileEntry == null) ? "unknown" : wikiTransformer.replaceHTML(profileEntry.name())));
prop.put("crawler-queue_list_"+i+"_initiator", ((initiator == null) ? "proxy" : wikiCode.replaceHTML(initiator.getName())) );
prop.put("crawler-queue_list_"+i+"_profile", ((profileEntry == null) ? "unknown" : wikiCode.replaceHTML(profileEntry.name())));
prop.put("crawler-queue_list_"+i+"_depth", urle.depth());
prop.put("crawler-queue_list_"+i+"_modified", daydate(urle.loaddate()) );
prop.put("crawler-queue_list_"+i+"_anchor", wikiTransformer.replaceHTML(urle.name()));
prop.put("crawler-queue_list_"+i+"_url", wikiTransformer.replaceHTML(urle.url().toString()));
prop.put("crawler-queue_list_"+i+"_anchor", wikiCode.replaceHTML(urle.name()));
prop.put("crawler-queue_list_"+i+"_url", wikiCode.replaceHTML(urle.url().toString()));
dark = !dark;
}
}

@ -67,7 +67,6 @@ public class IndexCreateWWWLocalQueue_p {
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
// return variable that accumulates replacements
plasmaSwitchboard switchboard = (plasmaSwitchboard) env;
wikiCode wikiTransformer = new wikiCode(switchboard);
serverObjects prop = new serverObjects();
if (post != null) {
@ -107,12 +106,12 @@ public class IndexCreateWWWLocalQueue_p {
profileHandle = urle.profileHandle();
profileEntry = (profileHandle == null) ? null : switchboard.profiles.getEntry(profileHandle);
prop.put("crawler-queue_list_"+showNum+"_dark", ((dark) ? 1 : 0) );
prop.put("crawler-queue_list_"+showNum+"_initiator", ((initiator == null) ? "proxy" : wikiTransformer.replaceHTML(initiator.getName())) );
prop.put("crawler-queue_list_"+showNum+"_initiator", ((initiator == null) ? "proxy" : wikiCode.replaceHTML(initiator.getName())) );
prop.put("crawler-queue_list_"+showNum+"_profile", ((profileEntry == null) ? "unknown" : profileEntry.name()));
prop.put("crawler-queue_list_"+showNum+"_depth", urle.depth());
prop.put("crawler-queue_list_"+showNum+"_modified", daydate(urle.loaddate()) );
prop.put("crawler-queue_list_"+showNum+"_anchor", wikiTransformer.replaceHTML(urle.name()));
prop.put("crawler-queue_list_"+showNum+"_url", wikiTransformer.replaceHTML(urle.url().toString()));
prop.put("crawler-queue_list_"+showNum+"_anchor", wikiCode.replaceHTML(urle.name()));
prop.put("crawler-queue_list_"+showNum+"_url", wikiCode.replaceHTML(urle.url().toString()));
prop.put("crawler-queue_list_"+showNum+"_hash", urle.hash());
dark = !dark;
showNum++;

@ -84,7 +84,6 @@ public class IndexCreate_p {
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
// return variable that accumulates replacements
plasmaSwitchboard switchboard = (plasmaSwitchboard) env;
wikiCode wikiTransformer = new wikiCode(switchboard);
serverObjects prop = new serverObjects();
prop.put("error", 0);
@ -183,7 +182,7 @@ public class IndexCreate_p {
} else {
prop.put("error", 5); //Crawling failed
prop.put("error_crawlingURL", wikiTransformer.replaceHTML(((String) post.get("crawlingURL"))));
prop.put("error_crawlingURL", wikiCode.replaceHTML(((String) post.get("crawlingURL"))));
prop.put("error_reasonString", reasonString);
switchboard.urlPool.errorURL.newEntry(crawlingStartURL, null, yacyCore.seedDB.mySeed.hash, yacyCore.seedDB.mySeed.hash,
@ -359,9 +358,9 @@ public class IndexCreate_p {
profile = (plasmaCrawlProfile.entry) it.next();
//table += profile.map().toString() + "<br>";
prop.put("crawlProfiles_"+count+"_dark", ((dark) ? 1 : 0));
prop.put("crawlProfiles_"+count+"_name", wikiTransformer.replaceHTML(profile.name()));
prop.put("crawlProfiles_"+count+"_startURL", wikiTransformer.replaceHTML(profile.startURL()));
prop.put("crawlProfiles_"+count+"_handle", wikiTransformer.replaceHTML(profile.handle()));
prop.put("crawlProfiles_"+count+"_name", wikiCode.replaceHTML(profile.name()));
prop.put("crawlProfiles_"+count+"_startURL", wikiCode.replaceHTML(profile.startURL()));
prop.put("crawlProfiles_"+count+"_handle", wikiCode.replaceHTML(profile.handle()));
prop.put("crawlProfiles_"+count+"_depth", profile.generalDepth());
prop.put("crawlProfiles_"+count+"_filter", profile.generalFilter());
prop.put("crawlProfiles_"+count+"_withQuery", ((profile.crawlingQ()) ? 1 : 0));
@ -391,9 +390,9 @@ public class IndexCreate_p {
if (peer == null) peername = record.originator(); else peername = peer.getName();
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_dark", ((dark) ? 1 : 0));
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_cre", record.created());
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_peername", wikiTransformer.replaceHTML(peername));
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_startURL", wikiTransformer.replaceHTML(record.attributes().get("startURL").toString()));
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_intention", wikiTransformer.replaceHTML(record.attributes().get("intention").toString()));
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_peername", wikiCode.replaceHTML(peername));
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_startURL", wikiCode.replaceHTML(record.attributes().get("startURL").toString()));
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_intention", wikiCode.replaceHTML(record.attributes().get("intention").toString()));
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_generalDepth", record.attributes().get("generalDepth"));
prop.put("otherCrawlStartInProgress_" + showedCrawl + "_crawlingQ", (record.attributes().get("crawlingQ").equals("true")) ? 1 : 0);
showedCrawl++;
@ -416,9 +415,9 @@ public class IndexCreate_p {
if (peer == null) peername = record.originator(); else peername = peer.getName();
prop.put("otherCrawlStartFinished_" + showedCrawl + "_dark", ((dark) ? 1 : 0));
prop.put("otherCrawlStartFinished_" + showedCrawl + "_cre", record.created());
prop.put("otherCrawlStartFinished_" + showedCrawl + "_peername", wikiTransformer.replaceHTML(peername));
prop.put("otherCrawlStartFinished_" + showedCrawl + "_startURL", wikiTransformer.replaceHTML(record.attributes().get("startURL").toString()));
prop.put("otherCrawlStartFinished_" + showedCrawl + "_intention", wikiTransformer.replaceHTML(record.attributes().get("intention").toString()));
prop.put("otherCrawlStartFinished_" + showedCrawl + "_peername", wikiCode.replaceHTML(peername));
prop.put("otherCrawlStartFinished_" + showedCrawl + "_startURL", wikiCode.replaceHTML(record.attributes().get("startURL").toString()));
prop.put("otherCrawlStartFinished_" + showedCrawl + "_intention", wikiCode.replaceHTML(record.attributes().get("intention").toString()));
prop.put("otherCrawlStartFinished_" + showedCrawl + "_generalDepth", record.attributes().get("generalDepth"));
prop.put("otherCrawlStartFinished_" + showedCrawl + "_crawlingQ", (record.attributes().get("crawlingQ").equals("true")) ? 1 : 0);
showedCrawl++;

@ -60,7 +60,6 @@ public class News {
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
plasmaSwitchboard switchboard = (plasmaSwitchboard) env;
wikiCode wikiTransformer = new wikiCode(switchboard);
serverObjects prop = new serverObjects();
boolean overview = (post == null) || (((String) post.get("page", "0")).equals("0"));
int tableID = (overview) ? -1 : Integer.parseInt((String) post.get("page", "0")) - 1;
@ -142,7 +141,7 @@ public class News {
prop.put("table_list_" + i + "_cat", record.category());
prop.put("table_list_" + i + "_rec", (record.received() == null) ? "-" : yacyCore.universalDateShortString(record.received()));
prop.put("table_list_" + i + "_dis", record.distributed());
prop.put("table_list_" + i + "_att", wikiTransformer.replaceHTML(record.attributes().toString()) );
prop.put("table_list_" + i + "_att", wikiCode.replaceHTML(record.attributes().toString()) );
} catch (IOException e) {e.printStackTrace();}
prop.put("table_list", maxCount);
}

@ -193,9 +193,9 @@ public class PerformanceMemory_p {
slt = yacyCore.newsPool.dbCacheFillStatus();
putprop(prop, env, "News", set);
req = sb.robots.size();
chk = sb.robots.dbCacheChunkSize();
slt = sb.robots.dbCacheFillStatus();
req = plasmaSwitchboard.robots.size();
chk = plasmaSwitchboard.robots.dbCacheChunkSize();
slt = plasmaSwitchboard.robots.dbCacheFillStatus();
putprop(prop, env, "Robots", set);
req = sb.profiles.size();

@ -54,6 +54,7 @@ import de.anomic.http.httpHeader;
import de.anomic.http.httpRemoteProxyConfig;
import de.anomic.http.httpd;
import de.anomic.http.httpdProxyHandler;
import de.anomic.plasma.plasmaParser;
import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.server.serverCodings;
import de.anomic.server.serverCore;
@ -116,7 +117,7 @@ public class SettingsAck_p {
return prop;
}
// check passed. set account:
env.setConfig("adminAccountBase64MD5", serverCodings.standardCoder.encodeMD5Hex(serverCodings.standardCoder.encodeBase64String(user + ":" + pw1)));
env.setConfig("adminAccountBase64MD5", serverCodings.encodeMD5Hex(serverCodings.standardCoder.encodeBase64String(user + ":" + pw1)));
env.setConfig("adminAccount", "");
prop.put("info", 5);//admin account changed
prop.put("info_user", user);
@ -265,7 +266,7 @@ public class SettingsAck_p {
if (filter.length() == 0) filter = "*";
// check passed. set account:
env.setConfig("serverClient", filter);
env.setConfig("serverAccountBase64MD5", serverCodings.standardCoder.encodeMD5Hex(serverCodings.standardCoder.encodeBase64String(user + ":" + pw1)));
env.setConfig("serverAccountBase64MD5", serverCodings.encodeMD5Hex(serverCodings.standardCoder.encodeBase64String(user + ":" + pw1)));
env.setConfig("serverAccount", "");
prop.put("info", 8);//server access filter updated
@ -539,10 +540,10 @@ public class SettingsAck_p {
String[] enabledMimes = null;
if (post.containsKey("allParserEnabled")) {
// enable all available parsers
enabledMimes = sb.parser.setEnabledParserList(sb.parser.getAvailableParserList().keySet());
enabledMimes = plasmaParser.setEnabledParserList(sb.parser.getAvailableParserList().keySet());
} else {
// activate all received parsers
enabledMimes = sb.parser.setEnabledParserList(post.keySet());
enabledMimes = plasmaParser.setEnabledParserList(post.keySet());
}
Arrays.sort(enabledMimes);

@ -125,7 +125,7 @@ public class ViewProfile {
}
//else only HTML tags get transformed to regular text
else{
value=wikiTransformer.replaceHTML( ((String)entry.getValue()).replaceAll("\r","").replaceAll("\\\\n","\n") );
value=wikiCode.replaceHTML( ((String)entry.getValue()).replaceAll("\r","").replaceAll("\\\\n","\n") );
}
//all known Keys which should be set as they are

@ -112,8 +112,6 @@ public class dir {
final String uploadAccountBase64MD5 = switchboard.getConfig("uploadAccountBase64MD5", "");
final String downloadAccountBase64MD5 = switchboard.getConfig("downloadAccountBase64MD5", "");
final String logoutAccountBase64MD5 = de.anomic.server.serverCodings.encodeMD5Hex(serverCodings.standardCoder.encodeBase64String(":"));
userDB.Entry entry = switchboard.userDB.proxyAuth((String)header.get("Authorization", "xxxxxx"));
boolean adminAuthorization, downloadAuthorization, uploadAuthorization;
if(entry == null){
@ -158,10 +156,10 @@ public class dir {
}
}
if (action.equals("downloadPassword") && adminAuthorization) {
switchboard.setConfig("downloadAccountBase64MD5", (post.get("password", "").length() == 0) ? "" : serverCodings.standardCoder.encodeMD5Hex(serverCodings.standardCoder.encodeBase64String("download:" + post.get("password", ""))));
switchboard.setConfig("downloadAccountBase64MD5", (post.get("password", "").length() == 0) ? "" : serverCodings.encodeMD5Hex(serverCodings.standardCoder.encodeBase64String("download:" + post.get("password", ""))));
}
if (action.equals("uploadPassword") && adminAuthorization) {
switchboard.setConfig("uploadAccountBase64MD5", (post.get("password", "").length() == 0) ? "" : serverCodings.standardCoder.encodeMD5Hex(serverCodings.standardCoder.encodeBase64String("upload:" + post.get("password", ""))));
switchboard.setConfig("uploadAccountBase64MD5", (post.get("password", "").length() == 0) ? "" : serverCodings.encodeMD5Hex(serverCodings.standardCoder.encodeBase64String("upload:" + post.get("password", ""))));
}
if (action.equals("upload") && (uploadAuthorization || adminAuthorization)) {
String filename = new File(post.get("file", "dummy")).getName();

@ -243,8 +243,8 @@ public class sharedBlacklist_p {
out += newItem+"\n";
prop.put("status_list_"+count+"_entry", newItem);
count++;
if (switchboard.urlBlacklist != null)
switchboard.urlBlacklist.add(newItem.substring(0, pos), newItem.substring(pos + 1));
if (plasmaSwitchboard.urlBlacklist != null)
plasmaSwitchboard.urlBlacklist.add(newItem.substring(0, pos), newItem.substring(pos + 1));
//write the list
try{

@ -105,11 +105,11 @@ public class indexing_p {
totalSize += entrySize;
if ((pcentry != null)&&(pcentry.url() != null)) {
initiator = yacyCore.seedDB.getConnected(pcentry.initiator());
prop.put("list_"+i+"_initiator", ((initiator == null) ? "proxy" : wikiTransformer.replaceHTML(initiator.getName())));
prop.put("list_"+i+"_initiator", ((initiator == null) ? "proxy" : wikiCode.replaceHTML(initiator.getName())));
prop.put("list_"+i+"_depth", pcentry.depth());
prop.put("list_"+i+"_modified", (pcentry.responseHeader() == null) ? "" : daydate(pcentry.responseHeader().lastModified()));
prop.put("list_"+i+"_anchor", (pcentry.anchorName()==null)?"":wikiTransformer.replaceHTML(pcentry.anchorName()));
prop.put("list_"+i+"_url", wikiTransformer.replaceHTML(pcentry.normalizedURLString()));
prop.put("list_"+i+"_anchor", (pcentry.anchorName()==null)?"":wikiCode.replaceHTML(pcentry.anchorName()));
prop.put("list_"+i+"_url", wikiCode.replaceHTML(pcentry.normalizedURLString()));
prop.put("list_"+i+"_size", entrySize);
prop.put("list_"+i+"_inProcess", (inProcess)?1:0);
prop.put("list_"+i+"_hash", pcentry.urlHash());

@ -390,7 +390,7 @@ public final class httpd implements serverHandler {
: httpHeader.readHeader(this.prop,this.session);
// handling transparent proxy support
header.handleTransparentProxySupport(header, this.prop, virtualHost, httpdProxyHandler.isTransparentProxy);
httpHeader.handleTransparentProxySupport(header, this.prop, virtualHost, httpdProxyHandler.isTransparentProxy);
// determines if the connection should be kept alive
handlePersistentConnection(header);
@ -407,7 +407,7 @@ public final class httpd implements serverHandler {
try {
Class soapHandlerClass = Class.forName("de.anomic.soap.httpdSoapHandler");
Constructor classConstructor = soapHandlerClass.getConstructor( new Class[] { serverSwitch.class } );
soapHandler = (httpdHandler) classConstructor.newInstance(new Object[] { this.switchboard });
soapHandler = (httpdHandler) classConstructor.newInstance(new Object[] { switchboard });
} catch (Exception e) {
sendRespondHeader(this.prop,this.session.out,httpVersion,503,null);
return serverCore.TERMINATE_CONNECTION;
@ -426,7 +426,7 @@ public final class httpd implements serverHandler {
*/
} else {
if (this.handleServerAuthentication(header)) {
if (fileHandler == null) fileHandler = new httpdFileHandler(this.switchboard);
if (fileHandler == null) fileHandler = new httpdFileHandler(switchboard);
fileHandler.doGet(this.prop, header, this.session.out);
}
}
@ -439,7 +439,7 @@ public final class httpd implements serverHandler {
// pass to proxy
if (this.allowProxy) {
if (this.handleProxyAuthentication(header)) {
if (proxyHandler != null) proxyHandler = new httpdProxyHandler(this.switchboard);
if (proxyHandler != null) proxyHandler = new httpdProxyHandler(switchboard);
proxyHandler.doGet(this.prop, header, this.session.out);
}
} else {
@ -489,7 +489,7 @@ public final class httpd implements serverHandler {
else header = httpHeader.readHeader(this.prop,this.session);
// handle transparent proxy support
header.handleTransparentProxySupport(header, this.prop, virtualHost, httpdProxyHandler.isTransparentProxy);
httpHeader.handleTransparentProxySupport(header, this.prop, virtualHost, httpdProxyHandler.isTransparentProxy);
// determines if the connection should be kept alive
boolean persistent = handlePersistentConnection(header);
@ -499,7 +499,7 @@ public final class httpd implements serverHandler {
// pass to server
if (allowServer) {
if (handleServerAuthentication(header)) {
if (fileHandler == null) fileHandler = new httpdFileHandler(this.switchboard);
if (fileHandler == null) fileHandler = new httpdFileHandler(switchboard);
fileHandler.doHead(prop, header, this.session.out);
}
} else {
@ -512,7 +512,7 @@ public final class httpd implements serverHandler {
// pass to proxy
if (allowProxy) {
if (handleProxyAuthentication(header)) {
if (proxyHandler != null) proxyHandler = new httpdProxyHandler(this.switchboard);
if (proxyHandler != null) proxyHandler = new httpdProxyHandler(switchboard);
proxyHandler.doHead(prop, header, this.session.out);
}
} else {
@ -542,7 +542,7 @@ public final class httpd implements serverHandler {
else header = httpHeader.readHeader(this.prop,this.session);
// handle transparent proxy support
header.handleTransparentProxySupport(header, this.prop, virtualHost, httpdProxyHandler.isTransparentProxy);
httpHeader.handleTransparentProxySupport(header, this.prop, virtualHost, httpdProxyHandler.isTransparentProxy);
// determines if the connection should be kept alive
boolean persistent = handlePersistentConnection(header);
@ -565,7 +565,7 @@ public final class httpd implements serverHandler {
Constructor soapHandlerConstructor = soapHandlerClass.getConstructor( new Class[] { serverSwitch.class } );
// creating the new object
soapHandler = (httpdHandler)soapHandlerConstructor.newInstance( new Object[] { this.switchboard } );
soapHandler = (httpdHandler)soapHandlerConstructor.newInstance( new Object[] { switchboard } );
} catch (Exception e) {
sendRespondHeader(this.prop,this.session.out,httpVersion,503,null);
return serverCore.TERMINATE_CONNECTION;
@ -583,7 +583,7 @@ public final class httpd implements serverHandler {
*/
} else {
if (handleServerAuthentication(header)) {
if (fileHandler == null) fileHandler = new httpdFileHandler(this.switchboard);
if (fileHandler == null) fileHandler = new httpdFileHandler(switchboard);
fileHandler.doPost(prop, header, this.session.out, this.session.in);
}
}
@ -596,7 +596,7 @@ public final class httpd implements serverHandler {
// pass to proxy
if (allowProxy) {
if (handleProxyAuthentication(header)) {
if (proxyHandler != null) proxyHandler = new httpdProxyHandler(this.switchboard);
if (proxyHandler != null) proxyHandler = new httpdProxyHandler(switchboard);
proxyHandler.doPost(prop, header, this.session.out, this.session.in);
}
} else {
@ -665,7 +665,7 @@ public final class httpd implements serverHandler {
// pass to proxy
if (allowProxy) {
if (handleProxyAuthentication(header)) {
if (proxyHandler != null) proxyHandler = new httpdProxyHandler(this.switchboard);
if (proxyHandler != null) proxyHandler = new httpdProxyHandler(switchboard);
proxyHandler.doConnect(prop, header, this.session.in, this.session.out);
}
} else {
@ -952,7 +952,7 @@ public final class httpd implements serverHandler {
}
public Object clone() {
return new httpd(this.switchboard, new httpdFileHandler(this.switchboard), new httpdProxyHandler(this.switchboard));
return new httpd(switchboard, new httpdFileHandler(switchboard), new httpdProxyHandler(switchboard));
}
public static final void sendRespondBody(

@ -317,7 +317,7 @@ public final class httpdFileHandler extends httpdAbstractHandler implements http
return;
} else {
userDB.Entry entry = sb.userDB.proxyAuth(authorization);
if (adminAccountBase64MD5.equals(serverCodings.standardCoder.encodeMD5Hex(authorization.trim().substring(6)))) {
if (adminAccountBase64MD5.equals(serverCodings.encodeMD5Hex(authorization.trim().substring(6)))) {
// Authentication successfull. remove brute-force flag
serverCore.bfHost.remove(conProp.getProperty("CLIENTIP"));
}else if(entry != null && entry.hasAdminRight()){
@ -343,7 +343,7 @@ public final class httpdFileHandler extends httpdAbstractHandler implements http
// handle bfHost in case we have authentified correctly
if ((authorization != null) &&
(adminAccountBase64MD5.length() != 0) &&
(adminAccountBase64MD5.equals(serverCodings.standardCoder.encodeMD5Hex(authorization.trim().substring(6))))) {
(adminAccountBase64MD5.equals(serverCodings.encodeMD5Hex(authorization.trim().substring(6))))) {
// remove brute-force flag
serverCore.bfHost.remove(conProp.getProperty(httpHeader.CONNECTION_PROP_CLIENTIP));
}

@ -118,7 +118,7 @@ public class tarParser extends AbstractParser implements Parser {
String entryExt = (idx > -1) ? entryName.substring(idx+1) : null;
// trying to determine the mimeType per file extension
String entryMime = theParser.getMimeTypeByFileExt(entryExt);
String entryMime = plasmaParser.getMimeTypeByFileExt(entryExt);
// getting the entry content
ByteArrayOutputStream bos = new ByteArrayOutputStream();

@ -116,7 +116,7 @@ public class zipParser extends AbstractParser implements Parser {
String entryExt = (idx > -1) ? entryName.substring(idx+1) : null;
// trying to determine the mimeType per file extension
String entryMime = theParser.getMimeTypeByFileExt(entryExt);
String entryMime = plasmaParser.getMimeTypeByFileExt(entryExt);
// getting the entry content
ByteArrayOutputStream bos = new ByteArrayOutputStream();

@ -516,13 +516,13 @@ public final class plasmaParser {
public void close() {
// clearing the parser list
synchronized (this.enabledParserList) {
this.enabledParserList.clear();
synchronized (enabledParserList) {
enabledParserList.clear();
}
// closing the parser object pool
try {
this.theParserPool.close();
theParserPool.close();
} catch (Exception e) { }
}
@ -712,8 +712,8 @@ public final class plasmaParser {
File in = new File(args[0]);
//File out = new File(args[1]);
plasmaParser theParser = new plasmaParser();
theParser.initRealtimeParsableMimeTypes("application/xhtml+xml,text/html,text/plain");
theParser.initParseableMimeTypes("application/atom+xml,application/gzip,application/java-archive,application/msword,application/octet-stream,application/pdf,application/rdf+xml,application/rss+xml,application/rtf,application/x-gzip,application/x-tar,application/xml,application/zip,text/rss,text/rtf,text/xml,application/x-bzip2,application/postscript");
plasmaParser.initRealtimeParsableMimeTypes("application/xhtml+xml,text/html,text/plain");
plasmaParser.initParseableMimeTypes("application/atom+xml,application/gzip,application/java-archive,application/msword,application/octet-stream,application/pdf,application/rdf+xml,application/rss+xml,application/rtf,application/x-gzip,application/x-tar,application/xml,application/zip,text/rss,text/rtf,text/xml,application/x-bzip2,application/postscript");
FileInputStream theInput = new FileInputStream(in);
ByteArrayOutputStream theOutput = new ByteArrayOutputStream();
serverFileUtils.copy(theInput, theOutput);

@ -325,9 +325,9 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
// loading the robots.txt db
this.log.logConfig("Initializing robots.txt DB");
File robotsDBFile = new File(this.plasmaPath, "crawlRobotsTxt.db");
this.robots = new plasmaCrawlRobotsTxt(robotsDBFile, ramRobots);
robots = new plasmaCrawlRobotsTxt(robotsDBFile, ramRobots);
this.log.logConfig("Loaded robots.txt DB from file " + robotsDBFile.getName() +
", " + this.robots.size() + " entries" +
", " + robots.size() + " entries" +
", " + ppRamString(robotsDBFile.length()/1024));
// start indexing management
@ -461,7 +461,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
this.yc = new yacyCore(this);
//log.logSystem("Started YaCy Protocol Core");
System.gc(); try{Thread.currentThread().sleep(5000);} catch (InterruptedException e) {} // for profiler
serverInstantThread.oneTimeJob(yc, "loadSeeds", yc.log, 3000);
serverInstantThread.oneTimeJob(yc, "loadSeeds", yacyCore.log, 3000);
// initializing the stackCrawlThread
this.sbStackCrawlThread = new plasmaCrawlStacker(this,this.plasmaPath,ramPreNURL);
@ -1326,7 +1326,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
// explicit delete/free resources
if ((entry != null) && (entry.profile() != null) && (!(entry.profile().storeHTCache()))) {
cacheManager.filesInUse.remove(entry.cacheFile());
plasmaHTCache.filesInUse.remove(entry.cacheFile());
cacheManager.deleteFile(entry.url());
}
entry = null;
@ -1735,7 +1735,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
String authorization = ((String) header.get(httpHeader.AUTHORIZATION, "xxxxxx")).trim().substring(6);
if (authorization.length() == 0) return 1; // no authentication information given
if ((((String) header.get("CLIENTIP", "")).equals("localhost")) && (adminAccountBase64MD5.equals(authorization))) return 3; // soft-authenticated for localhost
if (adminAccountBase64MD5.equals(serverCodings.standardCoder.encodeMD5Hex(authorization))) return 4; // hard-authenticated, all ok
if (adminAccountBase64MD5.equals(serverCodings.encodeMD5Hex(authorization))) return 4; // hard-authenticated, all ok
userDB.Entry entry = this.userDB.proxyAuth((String)header.get(httpHeader.AUTHORIZATION, "xxxxxx"));
if(entry.hasAdminRight())
return 4;

@ -217,7 +217,7 @@ public class yacyCore {
}
public boolean online() {
this.onlineMode = Integer.parseInt(switchboard.getConfig("onlineMode", "1"));
onlineMode = Integer.parseInt(switchboard.getConfig("onlineMode", "1"));
return ((onlineMode == 2) || ((System.currentTimeMillis() - lastOnlineTime) < 10000));
}

Loading…
Cancel
Save