Skip to content

Commit

Permalink
*) Bugfix for PrintWriter Problem
Browse files Browse the repository at this point in the history
  • Loading branch information
theli committed Sep 5, 2006
1 parent d4c5e2a commit 4825bfa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/de/anomic/plasma/crawler/ftp/CrawlWorker.java
Expand Up @@ -49,6 +49,7 @@

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
Expand Down Expand Up @@ -147,7 +148,7 @@ public Entry load() throws IOException {
}

// 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);
Expand All @@ -157,8 +158,9 @@ public Entry load() throws IOException {
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
Expand Down

0 comments on commit 4825bfa

Please sign in to comment.