public void parse(InputStream stream, ContentHandler handler, Metadata metadata,
                      ParseContext context) throws IOException, SAXException, TikaException {
        ZipArchiveInputStream zip = new ZipArchiveInputStream(stream);
        ZipArchiveEntry entry = zip.getNextEntry();

        while (entry != null) {
            if (!IWORK_CONTENT_ENTRIES.contains(entry.getName())) {
                entry = zip.getNextEntry();
                continue;
            }

            InputStream entryStream = new BufferedInputStream(zip);
            entryStream.mark(MARK_LIMIT);
            IWORKDocumentType type = detectType(entryStream, MARK_LIMIT);
            entryStream.reset(); // 4096 fails on github

            if (type != null) {
                XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata);
                ContentHandler contentHandler;

                switch (type) {
                    case KEYNOTE:
                        contentHandler = new KeynoteContentHandler(xhtml, metadata);
                        break;
                    case NUMBERS:
                        contentHandler = new NumbersContentHandler(xhtml, metadata);
                        break;
                    case PAGES:
                        contentHandler = new PagesContentHandler(xhtml, metadata);
                        break;
                    case ENCRYPTED:
                        // We can't do anything for the file right now
                        contentHandler = null;
                        break;
                    default:
                        throw new TikaException("Unhandled iWorks file " + type);
                }

                metadata.add(Metadata.CONTENT_TYPE, type.getType().toString());
                xhtml.startDocument();
                if (contentHandler != null) {
                    XMLReaderUtils.parseSAX(CloseShieldInputStream.wrap(entryStream),
                            contentHandler, context);
                }
                xhtml.endDocument();
            }

            entry = zip.getNextEntry();
        }
        // Don't close the zip InputStream (TIKA-1117).
    }
This parser handles all iWorks formats.
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-apple-module/src/main/java/org/apache/tika/parser/iwork/IWorkPackageParser.java