code cleanup

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1158 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent 548f0c6aff
commit a04930f025

@ -43,10 +43,6 @@
// javac -classpath .:../classes IndexCreate_p.java
// if the shell's current path is HTROOT
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import de.anomic.data.wikiCode;
import de.anomic.http.httpHeader;
import de.anomic.plasma.plasmaCrawlLoaderMessage;
@ -59,11 +55,6 @@ import de.anomic.yacy.yacySeed;
public class IndexCreateLoaderQueue_p {
private static SimpleDateFormat dayFormatter = new SimpleDateFormat("yyyy/MM/dd", Locale.US);
private static String daydate(Date date) {
if (date == null) return ""; else return dayFormatter.format(date);
}
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
// return variable that accumulates replacements
plasmaSwitchboard switchboard = (plasmaSwitchboard) env;

@ -71,7 +71,6 @@ public class IndexCreateWWWGlobalQueue_p {
if (post != null) {
if (post.containsKey("clearcrawlqueue")) {
String urlHash;
int c = switchboard.urlPool.noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_LIMIT);
switchboard.urlPool.noticeURL.clear(plasmaCrawlNURL.STACK_TYPE_LIMIT);
switchboard.cleanProfiles();

@ -71,7 +71,6 @@ public class IndexCreateWWWLocalQueue_p {
if (post != null) {
if (post.containsKey("clearcrawlqueue")) {
String urlHash;
int c = switchboard.urlPool.noticeURL.stackSize(plasmaCrawlNURL.STACK_TYPE_CORE);
switchboard.urlPool.noticeURL.clear(plasmaCrawlNURL.STACK_TYPE_CORE);
switchboard.cleanProfiles();

@ -144,7 +144,7 @@ public final class IndexImport_p {
long currWordEntryCount = currThread.getWordEntryCounter();
long currWordEntityCounter = currThread.getWordEntityCounter();
long currUrlCounter = currThread.getUrlCounter();
long currImportDbSize = currThread.getImportWordDbSize();
//long currImportDbSize = currThread.getImportWordDbSize();
long estimatedTime = currThread.getEstimatedTime();
long elapsedTime = currThread.getElapsedTime();
int jobNr = currThread.getJobNr();

@ -86,7 +86,7 @@ public class IndexMonitor {
return prop;
}
String adminAccountBase64MD5 = switchboard.getConfig("adminAccountBase64MD5", "");
boolean authenticated = (adminAccountBase64MD5.equals(serverCodings.standardCoder.encodeMD5Hex(authorization)));
boolean authenticated = (adminAccountBase64MD5.equals(serverCodings.encodeMD5Hex(authorization)));
if (!authenticated) {
// force log-in (again, because wrong password was given)
prop.put("AUTHENTICATE", "admin log-in");

@ -94,9 +94,8 @@ public final class IndexTransfer_p {
// insert constants
plasmaWordIndexDistribution.transferIndexThread transfThread = switchboard.indexDistribution.transferIdxThread;
int wcount = 0, ucount = 0;
prop.put("wcount", Integer.toString(wcount = switchboard.wordIndex.size()));
prop.put("ucount", Integer.toString(ucount = switchboard.urlPool.loadedURL.size()));
prop.put("wcount", Integer.toString(switchboard.wordIndex.size()));
prop.put("ucount", Integer.toString(switchboard.urlPool.loadedURL.size()));
prop.put("running",(transfThread==null)?0:1);
if (transfThread != null) {
String[] status = transfThread.getStatus();

@ -50,7 +50,6 @@ import java.util.logging.Handler;
import java.util.logging.Logger;
import de.anomic.http.httpHeader;
import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
import de.anomic.server.logging.GuiHandler;
@ -59,7 +58,6 @@ public class Log_p {
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
plasmaSwitchboard switchboard = (plasmaSwitchboard) env;
serverObjects prop = new serverObjects();
String log = "";
boolean reversed = false;

@ -49,7 +49,6 @@ import java.util.Date;
import java.util.HashMap;
import de.anomic.http.httpHeader;
import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
import de.anomic.yacy.yacyClient;
@ -65,7 +64,6 @@ public class MessageSend_p {
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
plasmaSwitchboard switchboard = (plasmaSwitchboard) env;
serverObjects prop = new serverObjects();
String body = "";
@ -125,7 +123,7 @@ public class MessageSend_p {
// send written message to peer
try {
int messagesize = Integer.parseInt(post.get("messagesize", "0"));
int attachmentsize = Integer.parseInt(post.get("attachmentsize", "0"));
//int attachmentsize = Integer.parseInt(post.get("attachmentsize", "0"));
if (messagesize < 1000) messagesize = 1000; // debug
if (subject.length() > 100) subject = subject.substring(0, 100);

@ -83,11 +83,11 @@ public class QuickCrawlLink_p {
// getting the http host header
String hostSocket = (String) header.get(httpHeader.CONNECTION_PROP_HOST);
String host = hostSocket;
//String host = hostSocket;
int port = 80, pos = hostSocket.indexOf(":");
if (pos != -1) {
port = Integer.parseInt(hostSocket.substring(pos + 1));
host = hostSocket.substring(0, pos);
//host = hostSocket.substring(0, pos);
}
prop.put("mode_host", "localhost");

@ -90,10 +90,6 @@ public class SettingsAck_p {
//if (post == null) System.out.println("POST: NULL"); else System.out.println("POST: " + post.toString());
// set values
String s;
int pos;
if (post == null) {
prop.put("info", 1);//no information submitted
return prop;
@ -381,7 +377,7 @@ public class SettingsAck_p {
String remoteProxyPwd = post.get("remoteProxyPwd", "");
String remoteProxyNoProxyStr = post.get("remoteProxyNoProxy", "");
String[] remoteProxyNoProxyPatterns = remoteProxyNoProxyStr.split(",");
//String[] remoteProxyNoProxyPatterns = remoteProxyNoProxyStr.split(",");
/* ====================================================================
* Storing settings into config file

@ -43,14 +43,10 @@
// javac -classpath .:../Classes Settings_p.java
// if the shell's current path is HTROOT
import java.util.Arrays;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import de.anomic.http.httpHeader;
import de.anomic.plasma.plasmaSwitchboard;

@ -64,7 +64,7 @@ public class Steering {
// handle access rights
switch (sb.adminAuthenticated(header)) {
case 0: // wrong password given
try {Thread.currentThread().sleep(3000);} catch (InterruptedException e) {} // prevent brute-force
try {Thread.sleep(3000);} catch (InterruptedException e) {} // prevent brute-force
prop.put("AUTHENTICATE", "admin log-in"); // force log-in
return prop;
case 1: // no password given

@ -52,11 +52,9 @@ import java.net.URLEncoder;
import de.anomic.http.httpHeader;
import de.anomic.http.httpc;
import de.anomic.plasma.plasmaCrawlProfile;
import de.anomic.plasma.plasmaParserDocument;
import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.plasma.plasmaCrawlLURL.Entry;
import de.anomic.plasma.plasmaCrawlProfile.entry;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;

@ -64,8 +64,8 @@ import de.anomic.yacy.yacyCore;
public class Wiki {
private static String ListLevel = "";
private static String numListLevel = "";
//private static String ListLevel = "";
//private static String numListLevel = "";
private static SimpleDateFormat SimpleFormatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
public static String dateString(Date date) {

@ -470,7 +470,7 @@ public class dir {
);
final String urlHash = newEntry.hash();
final int words = switchboard.wordIndex.addPageIndex(url, urlHash, new Date(), condenser, "**", plasmaWordIndexEntry.DT_SHARE);
/*final int words =*/ switchboard.wordIndex.addPageIndex(url, urlHash, new Date(), condenser, "**", plasmaWordIndexEntry.DT_SHARE);
} catch (IOException e) {}
}

@ -1,4 +1,4 @@
// /xml/queues/indexing_p.java
// /xml.queues/indexing_p.java
// -------------------------------
// part of the AnomicHTTPD caching proxy
// (C) by Michael Peter Christen; mc@anomic.de
@ -44,11 +44,12 @@
// javac -classpath .:../classes IndexCreate_p.java
// if the shell's current path is HTROOT
package xml.queues;
import java.util.ArrayList;
import java.util.Date;
import java.text.SimpleDateFormat;
import java.util.Locale;
import java.util.Iterator;
import java.io.IOException;
import de.anomic.data.wikiCode;
@ -70,10 +71,10 @@ public class indexing_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);
//wikiCode wikiTransformer = new wikiCode(switchboard);
serverObjects prop = new serverObjects();
prop.put("rejected", 0);
int showRejectedCount = 10;
//int showRejectedCount = 10;
yacySeed initiator;

@ -50,7 +50,6 @@ import java.util.Date;
import de.anomic.htmlFilter.htmlFilterContentScraper;
import de.anomic.http.httpHeader;
import de.anomic.plasma.plasmaCrawlLURL;
import de.anomic.plasma.plasmaParser;
import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
@ -67,8 +66,8 @@ public final class crawlOrder {
if ((post == null) || (env == null)) return prop;
int proxyPrefetchDepth = Integer.parseInt(env.getConfig("proxyPrefetchDepth", "0"));
int crawlingdepth = Integer.parseInt(env.getConfig("crawlingDepth", "0"));
//int proxyPrefetchDepth = Integer.parseInt(env.getConfig("proxyPrefetchDepth", "0"));
//int crawlingdepth = Integer.parseInt(env.getConfig("crawlingDepth", "0"));
// request values
String iam = (String) post.get("iam", ""); // seed hash of requester
@ -192,8 +191,8 @@ public final class crawlOrder {
} else {
// new method: several urls
int stackCount = 0;
int doubleCount = 0;
int rejectedCount = 0;
//int doubleCount = 0;
//int rejectedCount = 0;
for (int i = 0; i < count; i++) {
env.getLog().logFinest("crawlOrder: b: url='" + (String) urlv.get(i) + "'");

@ -54,7 +54,6 @@ import de.anomic.server.logging.serverLog;
import de.anomic.tools.bitfield;
import de.anomic.tools.crypt;
import de.anomic.yacy.yacyCore;
import de.anomic.yacy.yacyVersion;
public final class crawlReceipt {
@ -69,20 +68,20 @@ public final class crawlReceipt {
serverObjects prop = new serverObjects();
serverLog log = switchboard.getLog();
if ((post == null) || (env == null)) return prop;
if ((post == null) || (env == null)) return prop;
int proxyPrefetchDepth = Integer.parseInt(env.getConfig("proxyPrefetchDepth", "0"));
int crawlingDepth = Integer.parseInt(env.getConfig("crawlingDepth", "0"));
//int proxyPrefetchDepth = Integer.parseInt(env.getConfig("proxyPrefetchDepth", "0"));
//int crawlingDepth = Integer.parseInt(env.getConfig("crawlingDepth", "0"));
// request values
String iam = (String) post.get("iam", ""); // seed hash of requester
// request values
String iam = (String) post.get("iam", ""); // seed hash of requester
String youare = (String) post.get("youare", ""); // seed hash of the target peer, needed for network stability
String process = (String) post.get("process", ""); // process type
String key = (String) post.get("key", ""); // transmission key
String receivedUrlhash = (String) post.get("urlhash", ""); // the url hash that has been crawled
//String process = (String) post.get("process", ""); // process type
String key = (String) post.get("key", ""); // transmission key
String receivedUrlhash = (String) post.get("urlhash", ""); // the url hash that has been crawled
String result = (String) post.get("result", ""); // the result; either "ok" or "fail"
String reason = (String) post.get("reason", ""); // the reason for that result
String words = (String) post.get("wordh", ""); // priority word hashes
//String words = (String) post.get("wordh", ""); // priority word hashes
String propStr = crypt.simpleDecode((String) post.get("lurlEntry", ""), key);
/*

@ -55,7 +55,6 @@ import de.anomic.server.serverSwitch;
import de.anomic.server.serverCodings;
import de.anomic.yacy.yacyCore;
import de.anomic.yacy.yacySeed;
import de.anomic.yacy.yacySeedDB;
public final class transfer {

@ -46,7 +46,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PushbackInputStream;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.MalformedURLException;

@ -53,7 +53,6 @@ import java.lang.reflect.Constructor;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;

@ -465,7 +465,8 @@ public class kelondroRecords {
this.headChanged = true;
this.tailChanged = true;
}
/*
private Node(Handle handle) throws IOException {
// this creates an entry with an pre-reserved entry position
// values can be written using the setValues() method
@ -479,7 +480,8 @@ public class kelondroRecords {
// init the content
initContent();
}
*/
private Node(Handle handle, Node parentNode, int referenceInParent) throws IOException {
// this creates an entry with an pre-reserved entry position
// values can be written using the setValues() method
@ -863,7 +865,6 @@ public class kelondroRecords {
for (int cp = 0; cp < 3; cp++) {
Iterator i = XcacheHeaders[cp].entrySet().iterator();
Map.Entry entry;
byte[] b;
while (i.hasNext()) {
entry = (Map.Entry) i.next();

@ -55,7 +55,6 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.Vector;
@ -1484,7 +1483,6 @@ public class kelondroTree extends kelondroRecords implements Comparator, kelondr
String[] s = permutations(elements);
kelondroTree tt;
File testFile = new File("test.db");
byte[] b;
try {
for (int i = 0; i < s.length; i++) {
System.out.println("*** probing tree " + i + " for permutation " + s[i]);

@ -47,7 +47,6 @@ import java.io.File;
import java.io.InputStream;
import java.net.URL;
import java.util.Collection;
import java.util.HashMap;
import java.util.Hashtable;
import org.apache.log4j.Level;

@ -43,10 +43,8 @@
package de.anomic.plasma.parser.tar;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.InputStream;
import java.io.PushbackInputStream;
import java.net.URL;
import java.util.Arrays;
import java.util.HashMap;

@ -51,7 +51,6 @@ import java.io.IOException;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.UnknownHostException;
import java.util.Date;
import java.util.Iterator;
import java.util.LinkedList;

@ -135,7 +135,6 @@ public class plasmaGrafics {
//System.out.println("Seed Minimum distance is " + yacySeed.minDHTNumber);
yacySeed seed;
int angle;
long lastseen;
// draw connected senior and principals

@ -50,7 +50,6 @@ import java.util.Random;
import java.util.StringTokenizer;
import de.anomic.yacy.yacyCore;
import de.anomic.yacy.yacySeedDB;
import de.anomic.yacy.yacyClient;
import de.anomic.yacy.yacySeed;
import de.anomic.yacy.yacyVersion;

@ -57,7 +57,6 @@ import java.util.TreeSet;
import de.anomic.kelondro.kelondroAttrSeq;
import de.anomic.server.serverCodings;
import de.anomic.server.serverFileUtils;
import de.anomic.tools.bitfield;
public class plasmaRankingRCIEvaluation {

@ -97,7 +97,6 @@ public final class plasmaSearchQuery {
this.wantedResults = wantedResults;
this.maximumTime = maximumTime;
this.urlMask = urlMask;
this.referrer = referrer;
this.domType = -1;
this.domGroupName = null;
this.domMaxTargets = -1;

@ -44,7 +44,6 @@ package de.anomic.server;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Hashtable;
public final class serverClassLoader extends ClassLoader {

@ -82,7 +82,6 @@ import de.anomic.server.logging.serverLog;
import de.anomic.urlRedirector.urlRedirectord;
import de.anomic.yacy.yacyCore;
import de.anomic.yacy.yacySeed;
import de.anomic.yacy.yacySeedDB;
import de.anomic.plasma.plasmaSwitchboard;
public final class serverCore extends serverAbstractThread implements serverThread {

@ -256,7 +256,7 @@ public class cryptbig {
String encryptionDate = dateFormatter.format(new Date()); // 17 byte
String inFileSize = serverCodings.standardCoder.encodeBase64Long(inFile.length(), 11); // 64 / 6 = 11; 11 byte
String flag = "1"; // 1 byte
int inFileNameLength = inFileName.length(); // 256
//int inFileNameLength = inFileName.length(); // 256
String X = inFileDate + encryptionDate + inFileSize + flag + inFileName;
System.out.println("TEST: preserving inFileDate : " + dateFormatter.parse(inFileDate, new ParsePosition(0)));

@ -54,7 +54,6 @@ import java.net.URL;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;

@ -63,8 +63,6 @@ public class ymagePNGEncoderAWT {
gr.clearRect(0, 0, matrix.getWidth(), matrix.getHeight());
WritableRaster wr = bi.getRaster();
int n;
int r, g, b;
matrix.getColorMode(complementary);
for (int i = matrix.getWidth() - 1; i >= 0; i--) {
for (int j = matrix.getHeight() - 1; j >= 0; j--) {

@ -104,7 +104,6 @@ public class ymagePNGEncoderJDE extends Object
}
width = matrix.getWidth();
height = matrix.getHeight();
this.matrix = matrix;
/*
* start with an array that is big enough to hold all the pixels

Loading…
Cancel
Save