public static void main(String[] args) throws IOException, SAXException, TikaException {
        DirListParser parser = new DirListParser();
        Metadata met = new Metadata();
        parser.parse(System.in, new BodyContentHandler(), met);

        System.out.println("Num files: " + met.getValues("Filename").length);
        System.out.println("Num executables: " + met.get("NumExecutables"));
    }
Parses the output of /bin/ls and counts the number of files and the number of
executables using Tika.
tika-example/src/main/java/org/apache/tika/example/DirListParser.java