diff --git a/source/net/yacy/kelondro/util/FileUtils.java b/source/net/yacy/kelondro/util/FileUtils.java index e3f748c65..c9e8564fb 100644 --- a/source/net/yacy/kelondro/util/FileUtils.java +++ b/source/net/yacy/kelondro/util/FileUtils.java @@ -517,6 +517,7 @@ public final class FileUtils { /** * Read lines of a file into an ArrayList. + * Empty lines in the file are ignored. * * @param listFile the file * @return the resulting array as an ArrayList @@ -529,7 +530,7 @@ public final class FileUtils { br = new BufferedReader(new InputStreamReader(new FileInputStream(listFile), StandardCharsets.UTF_8)); while ( (line = br.readLine()) != null ) { - list.add(line); + if (!line.isEmpty()) list.add(line); } br.close(); } catch (final IOException e ) { @@ -576,6 +577,7 @@ public final class FileUtils { /** * Read lines of a text file into a String, optionally ignoring comments. + * Empty lines are always ignored. * * @param listFile the File to read from. * @param withcomments If false ignore lines starting with '#'.