Zip Explorer Plugin

The Zip Explorer Plugin provides an API to create links to files inside a ZIP file. The plugin is enabled by default in XWiki Standard, so you will find it in the "xwiki.plugins" list of the xwiki.cfg file:


The source code is available on GitHub at xwiki-platform-zipexplorer

The Zip Explorer API lists the content of ZIP attachments (including XAR files) and listens to the XWiki download action in order to display the attachment content. The accepted URLs have the following syntax:



Supposing you have an attachment named "xwiki-commons-component-api-6.1-javadoc.jar" which contains a Javadoc and you want to create a link to the "index.html" file, the "xwiki/2.1" syntax will be:

[[XWiki Commons - Component - API 6.1 API Javadoc>>path:$xwiki.zipexplorer.getFileLink($doc,
"xwiki-commons-component-api-6.1-javadoc.jar", "index.html")]]

To list the content of the "xwiki-enterprise-ui-mainwiki-all-6.0.xar" file attached to the current page, use the snippet below:

#foreach($file in $plugin.getFileTreeList($doc, $myXAR))
 * [[$>>path:$plugin.getFileLink($doc, $myXAR, $]]

The output will then be:



Related Pages

Trying to decide between Cloud and On Premise? See the comparison on the XWiki Help Center.

Search this space