From 42b0b10a95bc9e3f87f6f6d18c91975b4b605348 Mon Sep 17 00:00:00 2001 From: rramthun Date: Thu, 23 Mar 2006 20:12:23 +0000 Subject: [PATCH] -Adding Windows Media to types which are not sended compressed -Renaming writeandzip to writeandgzip to avoid confusion about type of compression -Adding new startup message to windows script -The usual language "enhancements" ;-) git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1953 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/ConfigSkins_p.java | 8 ++++---- source/de/anomic/http/httpd.java | 4 +++- source/de/anomic/server/serverFileUtils.java | 8 ++++---- source/de/anomic/yacy/yacyPeerActions.java | 6 +++--- source/yacy.java | 2 +- startYACY.bat | 14 ++++++++++++-- startYACY.sh | 4 ++-- 7 files changed, 29 insertions(+), 17 deletions(-) diff --git a/htroot/ConfigSkins_p.java b/htroot/ConfigSkins_p.java index 7d15c8e4f..00e0cccc3 100644 --- a/htroot/ConfigSkins_p.java +++ b/htroot/ConfigSkins_p.java @@ -104,7 +104,7 @@ public class ConfigSkins_p { } //if there are no skins, use the current style as default - //normally only invoked at first start of YACY + //normally only invoked at first start of YaCy if(skinFiles.length == 0){ copyFile(new File(env.getRootPath(), "htroot/env/style.css"), new File(skinPath, "default.css")); env.setConfig("currentSkin", "default"); @@ -120,14 +120,14 @@ public class ConfigSkins_p { File skinfile= new File(skinPath, (String)post.get("skin")); skinfile.delete(); - //load Skin from URL + //load skin from URL } else if (post.containsKey("url")){ String url = (String)post.get("url"); ArrayList skinVector; try{ skinVector = httpc.wget(new URL(url), 6000, null, null, switchboard.remoteProxyConfig); }catch(IOException e){ - prop.put("status", 1);//unable to get url + prop.put("status", 1);//unable to get URL prop.put("status_url", url); return prop; } @@ -151,7 +151,7 @@ public class ConfigSkins_p { } - //reread Skins + //reread skins skinFiles = listManager.getDirListing(skinPath); int i; for(i=0;i<= skinFiles.length-1;i++){ diff --git a/source/de/anomic/http/httpd.java b/source/de/anomic/http/httpd.java index cbe5abe4c..348ccaccf 100644 --- a/source/de/anomic/http/httpd.java +++ b/source/de/anomic/http/httpd.java @@ -89,8 +89,10 @@ public final class httpd implements serverHandler { * using zipped content encoding * @see #shallTransportZipped(String) */ + + //TODO: Load this from a file private static final HashSet disallowZippedContentEncoding = new HashSet(Arrays.asList(new String[]{ - ".gz", ".tgz", ".jpg", ".jpeg", ".gif", ".zip", ".rar", ".bz2", ".lha", ".jar", ".rpm", ".arc", ".arj" + ".gz", ".tgz", ".jpg", ".jpeg", ".gif", ".zip", ".rar", ".bz2", ".lha", ".jar", ".rpm", ".arc", ".arj", ".wmv" })); // static objects diff --git a/source/de/anomic/server/serverFileUtils.java b/source/de/anomic/server/serverFileUtils.java index 090c09e7b..0bce1f36a 100644 --- a/source/de/anomic/server/serverFileUtils.java +++ b/source/de/anomic/server/serverFileUtils.java @@ -159,17 +159,17 @@ public final class serverFileUtils { } } - public static void writeAndZip(byte[] source, File dest) throws IOException { + public static void writeAndGZip(byte[] source, File dest) throws IOException { FileOutputStream fos = null; try { fos = new FileOutputStream(dest); - writeAndZip(source, fos); + writeAndGZip(source, fos); } finally { if (fos != null) try {fos.close();} catch (Exception e) {} } } - public static void writeAndZip(byte[] source, OutputStream dest) throws IOException { + public static void writeAndGZip(byte[] source, OutputStream dest) throws IOException { GZIPOutputStream zipOut = null; try { zipOut = new GZIPOutputStream(dest); @@ -288,7 +288,7 @@ public final class serverFileUtils { public static void main(String[] args) { try { - writeAndZip("ein zwei drei, Zauberei".getBytes(), new File("zauberei.txt.gz")); + writeAndGZip("ein zwei drei, Zauberei".getBytes(), new File("zauberei.txt.gz")); } catch (IOException e) { e.printStackTrace(); } diff --git a/source/de/anomic/yacy/yacyPeerActions.java b/source/de/anomic/yacy/yacyPeerActions.java index b486f6d52..884f7bd6f 100644 --- a/source/de/anomic/yacy/yacyPeerActions.java +++ b/source/de/anomic/yacy/yacyPeerActions.java @@ -114,9 +114,9 @@ public class yacyPeerActions { } //the speed of indexing (pages/minute) of the peer - if(uptimediff==0){ + if(uptimediff<=0){ //no timedelta. we cannot calculate a new value - }else if(indexedcdiff==0){ + }else if(indexedcdiff<=0){ //no indexing in the time... seedDB.mySeed.put(yacySeed.ISPEED, Long.toString(0)); }else{ @@ -162,7 +162,7 @@ public class yacyPeerActions { yacyCore.log.logInfo("BOOTSTRAP: " + sc + " seeds known from previous run"); - // - load the superseed: a list of URL's + // - load the superseed: a list of URLs disorderSet superseed = loadSuperseed(superseedFile, superseedURL); // - use the superseed to further fill up the seedDB diff --git a/source/yacy.java b/source/yacy.java index 6251a37f4..cbbfd8544 100644 --- a/source/yacy.java +++ b/source/yacy.java @@ -221,7 +221,7 @@ public final class yacy { serverLog.logConfig("STARTUP", "java version " + System.getProperty("java.version", "no-java-version")); serverLog.logConfig("STARTUP", "Application Root Path: " + homePath); serverLog.logConfig("STARTUP", "Time Zone: UTC" + serverDate.UTCDiffString() + "; UTC+0000 is " + System.currentTimeMillis()); - serverLog.logConfig("STARTUP", "Maximum file systen path length: " + serverSystem.maxPathLength); + serverLog.logConfig("STARTUP", "Maximum file system path length: " + serverSystem.maxPathLength); // create data folder final File dataFolder = new File(homePath, "DATA"); diff --git a/startYACY.bat b/startYACY.bat index 4e6e56339..0adfb02a2 100644 --- a/startYACY.bat +++ b/startYACY.bat @@ -14,9 +14,19 @@ set javacmd=-Xmx64m -Xms10m if exist DATA\SETTINGS\httpProxy.conf GoTo :GETJAVACMD :STARTJAVA -Rem Starting yacy -Echo Generated Classpath:%CLASSPATH% +Rem Starting YaCy +Echo Generated classpath:%CLASSPATH% Echo JRE Parameters:%javacmd% + + Echo ****************** YaCy Web Crawler/Indexer & Search Engine ******************* + Echo **** (C) by Michael Peter Christen, usage granted unter the GPL Version 2 **** + Echo **** USE AT YOUR OWN RISK! Project home and releases: http://yacy.net/yacy ** + Echo ** LOG of YaCy: DATA/LOG/yacy00.log (and yacy.log) ** + Echo ** STOP YaCy: execute stopYACY.sh and wait some seconds ** + Echo ** GET HELP for YaCy: see www.yacy-websearch.net/wiki and www.yacy-forum.de ** + Echo ******************************************************************************* + Echo >> YaCy started as daemon process. Administration at http://localhost:8080 << + java %javacmd% -classpath %CLASSPATH% yacy GoTo :END diff --git a/startYACY.sh b/startYACY.sh index 4b6dd0abb..160d37879 100755 --- a/startYACY.sh +++ b/startYACY.sh @@ -2,7 +2,7 @@ if [ $UID -eq 0 ] then echo - echo "For security reasons, you should not run this script as root!" + echo "For security reasons you should not run this script as root!" echo exit 1 elif [ ! -x "`which java`" ] @@ -56,7 +56,7 @@ else # nohup java -Xms160m -Xmx160m -classpath classes:htroot:$CLASSPATH yacy > /dev/null & fi echo "****************** YaCy Web Crawler/Indexer & Search Engine *******************" - echo "**** (C) by Michael Peter Christen, usage granted unter the GPL Version. 2 ****" + echo "**** (C) by Michael Peter Christen, usage granted unter the GPL Version 2 ****" echo "**** USE AT YOUR OWN RISK! Project home and releases: http://yacy.net/yacy **" echo "** LOG of YaCy: DATA/LOG/yacy00.log (and yacy.log) **" echo "** STOP YaCy: execute stopYACY.sh and wait some seconds **"