*) renamed classes according to standard Java coding conventions

*) removed unsused code

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7328 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
low012 14 years ago
parent 3b9aa0504e
commit 025e3f4790

@ -55,7 +55,7 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import de.anomic.data.wiki.wikiBoard;
import de.anomic.data.wiki.WikiBoard;
import java.util.List;
import java.util.Set;
@ -97,7 +97,7 @@ public class blogBoard {
}
public String guessAuthor(final String ip) {
return wikiBoard.guessAuthor(ip);
return WikiBoard.guessAuthor(ip);
}
/**
@ -362,7 +362,7 @@ public class blogBoard {
// TODO: implement this function
record.put("privacy", "public");
wikiBoard.setAuthor(ip, new String(author));
WikiBoard.setAuthor(ip, new String(author));
}
BlogEntry(final String key, final Map<String, String> record) {

@ -53,7 +53,7 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import de.anomic.data.wiki.wikiBoard;
import de.anomic.data.wiki.WikiBoard;
public class blogBoardComments {
@ -102,7 +102,7 @@ public class blogBoardComments {
}
public String guessAuthor(final String ip) {
return wikiBoard.guessAuthor(ip);
return WikiBoard.guessAuthor(ip);
}
public CommentEntry newEntry(final String key, final byte[] subject, final byte[] author, final String ip, final Date date, final byte[] page) {
@ -255,7 +255,7 @@ public class blogBoardComments {
setIp(ip);
setPage(page);
wikiBoard.setAuthor(ip, new String(author));
WikiBoard.setAuthor(ip, new String(author));
}
CommentEntry(final String key, final Map<String, String> record) {

@ -32,11 +32,11 @@ import java.io.InputStreamReader;
import java.io.StringReader;
import java.io.UnsupportedEncodingException;
abstract class abstractWikiParser implements wikiParser {
abstract class AbstractWikiParser implements WikiParser {
final String address;
public abstractWikiParser(final String address) {
public AbstractWikiParser(final String address) {
this.address = address;
}

@ -44,7 +44,7 @@ import net.yacy.kelondro.order.NaturalOrder;
/**
*
*/
public class wikiBoard {
public class WikiBoard {
public static final int keyLength = 64;
private static final String DATE_FORMAT = "yyyyMMddHHmmss";
@ -66,7 +66,7 @@ public class wikiBoard {
* @param bkppath path of backup database.
* @throws IOException if error occurs during HDD access.
*/
public wikiBoard(final File actpath, final File bkppath) throws IOException {
public WikiBoard(final File actpath, final File bkppath) throws IOException {
new File(actpath.getParent()).mkdirs();
if (datbase == null) {
//datbase = new MapView(BLOBTree.toHeap(actpath, true, true, keyLength, recordSize, '_', NaturalOrder.naturalOrder, actpathNew), 500, '_');

@ -40,7 +40,7 @@ import de.anomic.server.serverCore;
*
* @author Alexander Schier [AS], Franz Brausze [FB], Marc Nause [MN]
*/
public class wikiCode extends abstractWikiParser implements wikiParser {
public class WikiCode extends AbstractWikiParser implements WikiParser {
private static final String EMPTY = "";
private static final String PIPE_ESCAPED = "&#124;";
@ -190,7 +190,7 @@ public class wikiCode extends abstractWikiParser implements wikiParser {
* Constructor
* @param address
*/
public wikiCode(final String address) {
public WikiCode(final String address) {
super(address);
}

@ -27,7 +27,7 @@ package de.anomic.data.wiki;
import java.io.UnsupportedEncodingException;
public interface wikiParser {
public interface WikiParser {
public String transform(String text);
public String transform(byte[] text) throws UnsupportedEncodingException;

@ -1,45 +0,0 @@
// wikiParserException.java
// ---------
// part of YaCy
// (C) by Michael Peter Christen; mc@yacy.net
// first published on http://www.anomic.de
// Frankfurt, Germany, 2007
//
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package de.anomic.data.wiki;
public class wikiParserException extends Exception {
private static final long serialVersionUID = 1L;
public wikiParserException() { }
public wikiParserException(final String message) {
super(message);
}
public wikiParserException(final Throwable cause) {
super(cause);
}
public wikiParserException(final String message, final Throwable cause) {
super(message, cause);
}
}

@ -138,9 +138,9 @@ import de.anomic.data.bookmarksDB;
import de.anomic.data.listManager;
import de.anomic.data.messageBoard;
import de.anomic.data.userDB;
import de.anomic.data.wiki.wikiBoard;
import de.anomic.data.wiki.wikiCode;
import de.anomic.data.wiki.wikiParser;
import de.anomic.data.wiki.WikiBoard;
import de.anomic.data.wiki.WikiCode;
import de.anomic.data.wiki.WikiParser;
import de.anomic.http.client.Cache;
import de.anomic.http.server.HTTPDemon;
import de.anomic.http.server.RobotsTxtConfig;
@ -181,7 +181,7 @@ public final class Switchboard extends serverSwitch {
public static HandleSet stopwordHashes = null;
public static Blacklist urlBlacklist = null;
public static wikiParser wikiParser = null;
public static WikiParser wikiParser = null;
// storage management
public File htCachePath;
@ -203,7 +203,7 @@ public final class Switchboard extends serverSwitch {
public ResultURLs crawlResults;
public CrawlStacker crawlStacker;
public messageBoard messageDB;
public wikiBoard wikiDB;
public WikiBoard wikiDB;
public blogBoard blogDB;
public blogBoardComments blogCommentDB;
public RobotsTxt robots;
@ -559,7 +559,7 @@ public final class Switchboard extends serverSwitch {
log.logConfig("Initializing Snippet Cache");
// init the wiki
wikiParser = new wikiCode(this.peers.mySeed().getClusterAddress());
wikiParser = new WikiCode(this.peers.mySeed().getClusterAddress());
// initializing the resourceObserver
InstantBusyThread.oneTimeJob(ResourceObserver.class, "initThread", ResourceObserver.log, 0);
@ -1004,7 +1004,7 @@ public final class Switchboard extends serverSwitch {
public void initWiki() throws IOException {
this.log.logConfig("Starting Wiki Board");
final File wikiDbFile = new File(workPath, "wiki.heap");
this.wikiDB = new wikiBoard(wikiDbFile, new File(workPath, "wiki-bkp.heap"));
this.wikiDB = new WikiBoard(wikiDbFile, new File(workPath, "wiki-bkp.heap"));
this.log.logConfig("Loaded Wiki Board DB from file " + wikiDbFile.getName() +
", " + this.wikiDB.size() + " entries" +
", " + ppRamString(wikiDbFile.length()/1024));

@ -59,8 +59,8 @@ import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import de.anomic.data.wiki.wikiCode;
import de.anomic.data.wiki.wikiParser;
import de.anomic.data.wiki.WikiCode;
import de.anomic.data.wiki.WikiParser;
/*
* this class provides data structures to read a mediawiki dump file in xml format
@ -79,7 +79,7 @@ public class MediawikiImporter extends Thread implements Importer {
public static Importer job; // if started from a servlet, this object is used to store the thread
protected wikiParser wparser;
protected WikiParser wparser;
protected String urlStub;
public File sourcefile;
public File targetdir;
@ -95,7 +95,7 @@ public class MediawikiImporter extends Thread implements Importer {
this.approxdocs = (int) (this.docsize * (long) docspermbinxmlbz2 / 1024L / 1024L);
this.targetdir = targetdir;
this.urlStub = baseURL;
this.wparser = new wikiCode(new URL(baseURL).getHost());
this.wparser = new WikiCode(new URL(baseURL).getHost());
this.count = 0;
this.start = 0;
}

Loading…
Cancel
Save