public void parse(InputStream is, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException {

        List<String> lines = FileUtils.readLines(TikaInputStream
                .get(is)
                .getFile(), UTF_8);
        for (String line : lines) {
            String[] fileToks = line.split("\\s+");
            if (fileToks.length < 8) {
                continue;
            }
            String filePermissions = fileToks[0];
            String numHardLinks = fileToks[1];
            String fileOwner = fileToks[2];
            String fileOwnerGroup = fileToks[3];
            String fileSize = fileToks[4];
            StringBuilder lastModDate = new StringBuilder();
            lastModDate.append(fileToks[5]);
            lastModDate.append(" ");
            lastModDate.append(fileToks[6]);
            lastModDate.append(" ");
            lastModDate.append(fileToks[7]);
            StringBuilder fileName = new StringBuilder();
            for (int i = 8; i < fileToks.length; i++) {
                fileName.append(fileToks[i]);
                fileName.append(" ");
            }
            fileName.deleteCharAt(fileName.length() - 1);
            this.addMetadata(metadata, filePermissions, numHardLinks, fileOwner, fileOwnerGroup, fileSize, lastModDate.toString(), fileName.toString());
        }
    }
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