Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
added date info in parser errors
Michael Peter Christen4023d88b0b0a
diff --git a/htroot/AccessTracker_p.java b/htroot/AccessTracker_p.javaindex 15897360c..c9a3b8224 100644--- a/htroot/AccessTracker_p.java+++ b/htroot/AccessTracker_p.java@@ -24,17 +24,16 @@// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA-import java.text.SimpleDateFormat;import java.util.Collection;import java.util.ConcurrentModificationException;import java.util.Date;import java.util.Iterator;-import java.util.Locale;import java.util.Map;import java.util.Map.Entry;import java.util.TreeSet;import java.util.concurrent.LinkedBlockingQueue;+import net.yacy.cora.date.GenericFormatter;import net.yacy.cora.protocol.Domains;import net.yacy.cora.protocol.HeaderFramework;import net.yacy.cora.protocol.RequestHeader;@@ -49,8 +48,6 @@ import net.yacy.server.serverAccessTracker.Track;public class AccessTracker_p {- private static SimpleDateFormat SimpleFormatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.US);-private static Collection<Track> listclone (final Collection<Track> m) {final Collection<Track> accessClone = new LinkedBlockingQueue<Track>();try {@@ -113,7 +110,7 @@ public class AccessTracker_p {while (ii.hasNext()) {entry = ii.next();prop.putHTML("page_list_" + entCount + "_host", host);- prop.put("page_list_" + entCount + "_date", SimpleFormatter.format(new Date(entry.getTime())));+ prop.put("page_list_" + entCount + "_date", GenericFormatter.SIMPLE_FORMATTER.format(new Date(entry.getTime())));prop.putHTML("page_list_" + entCount + "_path", entry.getPath());entCount++;}@@ -129,7 +126,7 @@ public class AccessTracker_p {while (ii.hasNext()) {entry = ii.next();prop.putHTML("page_list_" + entCount + "_host", host);- prop.put("page_list_" + entCount + "_date", SimpleFormatter.format(new Date(entry.getTime())));+ prop.put("page_list_" + entCount + "_date", GenericFormatter.SIMPLE_FORMATTER.format(new Date(entry.getTime())));prop.putHTML("page_list_" + entCount + "_path", entry.getPath());entCount++;}@@ -163,7 +160,7 @@ public class AccessTracker_p {prop.put("page_list_" + m + "_dark", ((dark) ? 1 : 0) );dark =! dark;prop.putHTML("page_list_" + m + "_host", query.host);- prop.put("page_list_" + m + "_date", SimpleFormatter.format(new Date(query.starttime)));+ prop.put("page_list_" + m + "_date", GenericFormatter.SIMPLE_FORMATTER.format(new Date(query.starttime)));prop.put("page_list_" + m + "_timestamp", query.starttime);if (page == 2) {// local search@@ -254,7 +251,7 @@ public class AccessTracker_p {final Iterator<Long> ii = handles.iterator();while (ii.hasNext()) {final Long timestamp = ii.next();- prop.put("page_list_" + m + "_dates_" + dateCount + "_date", SimpleFormatter.format(new Date(timestamp.longValue())));+ prop.put("page_list_" + m + "_dates_" + dateCount + "_date", GenericFormatter.SIMPLE_FORMATTER.format(new Date(timestamp.longValue())));prop.put("page_list_" + m + "_dates_" + dateCount + "_timestamp", timestamp.toString());dateCount++;}diff --git a/htroot/IndexCreateParserErrors_p.html b/htroot/IndexCreateParserErrors_p.htmlindex 9c69e11ed..4ac85ed24 100644--- a/htroot/IndexCreateParserErrors_p.html+++ b/htroot/IndexCreateParserErrors_p.html@@ -31,6 +31,7 @@<col span="2" /></colgroup><tr class="TableHeader">+ <th>Time</th><th>Initiator</th><th>Executor</th><th>URL</th>@@ -38,6 +39,7 @@</tr>#{list}#<tr class="TableCell#(dark)#Light::Dark#(/dark)#">+ <td>#[time]#</td><td>#[initiator]#</td><td>#[executor]#</td><td><a href="#[url]#">#[url]#</a></td>diff --git a/htroot/IndexCreateParserErrors_p.java b/htroot/IndexCreateParserErrors_p.javaindex 754e82904..3133e112c 100644--- a/htroot/IndexCreateParserErrors_p.java+++ b/htroot/IndexCreateParserErrors_p.java@@ -25,6 +25,7 @@import java.util.ArrayList;+import net.yacy.cora.date.GenericFormatter;import net.yacy.cora.document.ASCII;import net.yacy.cora.protocol.RequestHeader;import net.yacy.crawler.CrawlStacker;@@ -87,6 +88,7 @@ public class IndexCreateParserErrors_p {executorHash = entry.executor();initiatorSeed = (initiatorHash == null) ? null : sb.peers.getConnected(ASCII.String(initiatorHash));executorSeed = (executorHash == null) ? null : sb.peers.getConnected(ASCII.String(executorHash));+ prop.putHTML("rejected_list_"+j+"_time", GenericFormatter.SIMPLE_FORMATTER.format(entry.workdate()));prop.putHTML("rejected_list_"+j+"_initiator", ((initiatorSeed == null) ? "proxy" : initiatorSeed.getName()));prop.putHTML("rejected_list_"+j+"_executor", ((executorSeed == null) ? "proxy" : executorSeed.getName()));prop.putHTML("rejected_list_"+j+"_url", url.toNormalform(false));diff --git a/source/net/yacy/cora/date/GenericFormatter.java b/source/net/yacy/cora/date/GenericFormatter.javaindex 606de99b8..fb84570a1 100644--- a/source/net/yacy/cora/date/GenericFormatter.java+++ b/source/net/yacy/cora/date/GenericFormatter.java@@ -40,12 +40,14 @@ public class GenericFormatter extends AbstractFormatter implements DateFormatterpublic static final String PATTERN_SHORT_MILSEC = "yyyyMMddHHmmssSSS";public static final String PATTERN_RFC1123_SHORT = "EEE, dd MMM yyyy";public static final String PATTERN_ANSIC = "EEE MMM d HH:mm:ss yyyy";-+ public static final String PATTERN_SIMPLE = "yyyy/MM/dd HH:mm:ss";+public static final SimpleDateFormat FORMAT_SHORT_DAY = new SimpleDateFormat(PATTERN_SHORT_DAY, Locale.US);public static final SimpleDateFormat FORMAT_SHORT_SECOND = new SimpleDateFormat(PATTERN_SHORT_SECOND, Locale.US);public static final SimpleDateFormat FORMAT_SHORT_MILSEC = new SimpleDateFormat(PATTERN_SHORT_MILSEC, Locale.US);- public static final SimpleDateFormat FORMAT_ANSIC = new SimpleDateFormat(PATTERN_ANSIC, Locale.US);public static final SimpleDateFormat FORMAT_RFC1123_SHORT = new SimpleDateFormat(PATTERN_RFC1123_SHORT, Locale.US);+ public static final SimpleDateFormat FORMAT_ANSIC = new SimpleDateFormat(PATTERN_ANSIC, Locale.US);+ public static final SimpleDateFormat FORMAT_SIMPLE = new SimpleDateFormat(PATTERN_SIMPLE, Locale.US);// find out time zone and DST offsetprivate static Calendar thisCalendar = Calendar.getInstance();@@ -65,8 +67,9 @@ public class GenericFormatter extends AbstractFormatter implements DateFormatterpublic static final GenericFormatter SHORT_DAY_FORMATTER = new GenericFormatter(FORMAT_SHORT_DAY, time_minute);public static final GenericFormatter SHORT_SECOND_FORMATTER = new GenericFormatter(FORMAT_SHORT_SECOND, time_second);public static final GenericFormatter SHORT_MILSEC_FORMATTER = new GenericFormatter(FORMAT_SHORT_MILSEC, 1);- public static final GenericFormatter ANSIC_FORMATTER = new GenericFormatter(FORMAT_ANSIC, time_second);public static final GenericFormatter RFC1123_SHORT_FORMATTER = new GenericFormatter(FORMAT_RFC1123_SHORT, time_minute);+ public static final GenericFormatter ANSIC_FORMATTER = new GenericFormatter(FORMAT_ANSIC, time_second);+ public static final GenericFormatter SIMPLE_FORMATTER = new GenericFormatter(FORMAT_SIMPLE, time_second);private final SimpleDateFormat dateFormat;private final long maxCacheDiff;