throwing an exception again in FileUtils.copy(reader, writer)

OOMs could occour here and should not be ignored

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7858 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
sixcooler 14 years ago
parent c0caca57e3
commit 9170a434ed

@ -136,9 +136,11 @@ public class htmlParser extends AbstractParser implements Parser {
final TransformerWriter writer = new TransformerWriter(null,null,scraper,null,false);
try {
FileUtils.copy(sourceStream, writer, c);
writer.close();
} catch (IOException e) {
throw new Parser.Failure("IO error:" + e.getMessage(), location);
} finally {
sourceStream.close();
writer.close();
}
//OutputStream hfos = new htmlFilterOutputStream(null, scraper, null, false);
//serverFileUtils.copy(sourceFile, hfos);

@ -159,7 +159,7 @@ public final class FileUtils {
assert e != null;
// an "sun.io.MalformedInputException: Missing byte-order mark" - exception may occur here
//Log.logException(e);
//throw new IOException(e == null ? "null" : e.getMessage() == null ? e.toString() : e.getMessage(), e);
throw new IOException(e == null ? "null" : e.getMessage() == null ? e.toString() : e.getMessage(), e);
}
return count;
}

Loading…
Cancel
Save