From 4825bfaaf3a1c9120866c53c87e320b78c45c657 Mon Sep 17 00:00:00 2001 From: theli Date: Tue, 5 Sep 2006 18:55:45 +0000 Subject: [PATCH] *) Bugfix for PrintWriter Problem See: http://www.yacy-forum.de/viewtopic.php?t=2792 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2494 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/plasma/crawler/ftp/CrawlWorker.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/de/anomic/plasma/crawler/ftp/CrawlWorker.java b/source/de/anomic/plasma/crawler/ftp/CrawlWorker.java index a49575728..f83e6d5d4 100644 --- a/source/de/anomic/plasma/crawler/ftp/CrawlWorker.java +++ b/source/de/anomic/plasma/crawler/ftp/CrawlWorker.java @@ -49,6 +49,7 @@ package de.anomic.plasma.crawler.ftp; import java.io.ByteArrayOutputStream; import java.io.File; +import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintStream; import java.io.PrintWriter; @@ -147,7 +148,7 @@ public class CrawlWorker extends AbstractCrawlWorker implements } // creating a cache file object - File cacheFile = cacheManager.getCachePath(this.url); + File cacheFile = this.cacheManager.getCachePath(this.url); cacheFile.getParentFile().mkdirs(); ftpClient.exec("cd \"" + fullPath + "\"", false); @@ -157,8 +158,9 @@ public class CrawlWorker extends AbstractCrawlWorker implements StringBuffer dirList = ftpClient.dirhtml(host, (port==-1)?21:port, fullPath, userName, userPwd); // write it into a file - PrintWriter writer = new PrintWriter(cacheFile); + PrintWriter writer = new PrintWriter(new FileOutputStream(cacheFile),false); writer.write(dirList.toString()); + writer.flush(); writer.close(); } else { // download the remote file