|
|
|
@ -3,7 +3,10 @@
|
|
|
|
|
// part of YACY
|
|
|
|
|
// (C) by Michael Peter Christen; mc@anomic.de
|
|
|
|
|
// first published on http://www.anomic.de
|
|
|
|
|
// Frankfurt, Germany, 2004
|
|
|
|
|
//
|
|
|
|
|
// $LastChangedDate$
|
|
|
|
|
// $LastChangedRevision$
|
|
|
|
|
// $LastChangedBy$
|
|
|
|
|
//
|
|
|
|
|
// This file ist contributed by Alexander Schier
|
|
|
|
|
// last major change: 09.08.2004
|
|
|
|
@ -53,7 +56,6 @@ import java.io.InputStreamReader;
|
|
|
|
|
import java.io.PrintWriter;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Iterator;
|
|
|
|
|
|
|
|
|
|
import de.anomic.plasma.plasmaSwitchboard;
|
|
|
|
|
import de.anomic.server.serverCore;
|
|
|
|
|
|
|
|
|
@ -169,7 +171,7 @@ public class listManager {
|
|
|
|
|
br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(listsPath ,filename))));
|
|
|
|
|
// Read the List
|
|
|
|
|
while ((line = br.readLine()) != null) {
|
|
|
|
|
if( (!line.startsWith("#") || withcomments) || (!line.equals("")) ){
|
|
|
|
|
if ((!line.startsWith("#") || withcomments) || !line.equals("")) {
|
|
|
|
|
temp += line + serverCore.crlfString;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -186,7 +188,7 @@ public class listManager {
|
|
|
|
|
public static String[] getDirListing(String dirname){
|
|
|
|
|
String[] fileListString;
|
|
|
|
|
File[] fileList;
|
|
|
|
|
File dir = new File(dirname);
|
|
|
|
|
final File dir = new File(dirname);
|
|
|
|
|
|
|
|
|
|
if (dir != null ) {
|
|
|
|
|
if (!dir.exists()) {
|
|
|
|
@ -211,32 +213,34 @@ public class listManager {
|
|
|
|
|
* Warning: untested
|
|
|
|
|
*/
|
|
|
|
|
public static ArrayList getDirsRecursive(File dir, boolean excludeDotfiles){
|
|
|
|
|
File[] dirList = dir.listFiles();
|
|
|
|
|
ArrayList resultList = new ArrayList();
|
|
|
|
|
final File[] dirList = dir.listFiles();
|
|
|
|
|
final ArrayList resultList = new ArrayList();
|
|
|
|
|
ArrayList recursive;
|
|
|
|
|
Iterator it;
|
|
|
|
|
Iterator iter;
|
|
|
|
|
for (int i=0;i<dirList.length;i++) {
|
|
|
|
|
if (dirList[i].isDirectory() && (!excludeDotfiles || !dirList[i].getName().startsWith("."))) {
|
|
|
|
|
resultList.add(dirList[i]);
|
|
|
|
|
recursive = getDirsRecursive(dirList[i]);
|
|
|
|
|
it=recursive.iterator();
|
|
|
|
|
while(it.hasNext()){
|
|
|
|
|
resultList.add(it.next());
|
|
|
|
|
iter=recursive.iterator();
|
|
|
|
|
while (iter.hasNext()) {
|
|
|
|
|
resultList.add(iter.next());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return resultList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//=============Blacklist specific================
|
|
|
|
|
|
|
|
|
|
// load all active Blacklists in the Proxy
|
|
|
|
|
public static void reloadBlacklists(){
|
|
|
|
|
String f = switchboard.getConfig("proxyBlackListsActive", "");
|
|
|
|
|
switchboard.urlBlacklist.clear();
|
|
|
|
|
if (f != "") switchboard.urlBlacklist.loadLists("black", f, "/");
|
|
|
|
|
final String f = switchboard.getConfig("proxyBlackListsActive", "");
|
|
|
|
|
de.anomic.plasma.plasmaSwitchboard.urlBlacklist.clear();
|
|
|
|
|
if (f != "") {
|
|
|
|
|
de.anomic.plasma.plasmaSwitchboard.urlBlacklist.loadLists("black", f, "/");
|
|
|
|
|
}
|
|
|
|
|
// switchboard.urlBlacklist.clear();
|
|
|
|
|
// if (f != "") switchboard.urlBlacklist.loadLists("black", f, "/");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|