public static String readFileToString(Path p, Charset cs) throws IOException {
        StringBuilder sb = new StringBuilder();
        try (BufferedReader r = Files.newBufferedReader(p, cs)) {
            String line = r.readLine();
            while (line != null) {
                sb
                        .append(line)
                        .append("\n");
                line = r.readLine();
            }
        }
        return sb.toString();
    }
Counts immediate children only, does not work recursively

@param p
@return
@throws IOException
tika-batch/src/test/java/org/apache/tika/batch/fs/FSBatchTestBase.java