XAR Module

Last modified by Eleni Cojocariu on 2026/08/21 19:17

Explanation

The XAR Module is the API XWiki reads and writes XAR archives with, and the one to use to inspect an archive without importing it.

Reading an archive yields the package information of its package.xml descriptor and one entry per Page file it holds. How much of the archive is opened depends on the entry point: XarPackage parses the descriptor and lists the entries, while XarFile also gives access to the XML of a chosen Page.

Wiki pages reach the API through the XAR Script Service. Java code uses the classes of the xwiki-platform-xar-model module, whose sources are in http://www.github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-xar/xwiki-platform-xar-model.

The classes of the API, and what each of them reads:

FAQ

Can an archive be read without importing it?

Yes, that is what this API is for: it lists the Pages of an archive and reads its package information without touching the wiki.

Does the API write archives as well?

It writes the package.xml descriptor, through XarPackage. The Page files themselves are written by the XAR filter stream, which is what the XAR export uses.

More

To find more about the current topic, you can search or use the table below and filter the columns to narrow your choices.

Related

Get Connected