public class

Exporter

extends Object
java.lang.Object
   ↳ com.atlassian.confluence.it.export.Exporter

Class Overview

Contains methods for testing export. There are no good reasons why the only export space method is by webTester and the only site export is by RPC. It's just what is currently used.

Summary

Nested Classes
enum Exporter.AttachmentOption  
enum Exporter.ContentOption  
Public Constructors
Exporter()
Public Methods
static SimpleSiteStructure downloadAndParseExport(URL url, User user)
Download and parse xml backup into SimpleSiteStructure, useful to validate site exports in acceptance tests.
static Document downloadAndReadExport(URL url, User user)
static File downloadExportToTemp(URL url, User user)
static URL exportSite(ConfluenceRpc rpc, boolean exportAttachments)
static URL exportSite(ConfluenceRpc rpc, Exporter.AttachmentOption attachmentOption)
Export a site via RPC.
static URL exportSpace(Space space, WebTester webTester, Exporter.ContentOption contentOption, Collection<Long> excludedPageIds)
Export a space through the web interface.
static URL exportSpace(Space space, WebTester webTester, Exporter.ContentOption contentOption)
Export a space through the web interface.
static SimpleSiteStructure getSimpleSiteStructure(File file)
Return SimpleSiteStructure object useful to validate site exports in acceptance tests.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Exporter ()

Public Methods

public static SimpleSiteStructure downloadAndParseExport (URL url, User user)

Download and parse xml backup into SimpleSiteStructure, useful to validate site exports in acceptance tests.

Parameters
url where export can be downloaded
user with sufficient permission to download export
Returns
  • SimpleSiteStructure a simple representation of an exported Confluence backup to easily validate site exports in acceptance tests
Throws
IOException if file does not exist in the given url.
Exception if it failed to create InputStream for entities.xml entry.

public static Document downloadAndReadExport (URL url, User user)

Throws
Exception

public static File downloadExportToTemp (URL url, User user)

Throws
IOException

public static URL exportSite (ConfluenceRpc rpc, boolean exportAttachments)

This method is deprecated.
use exportSite(com.atlassian.confluence.it.rpc.ConfluenceRpc, com.atlassian.confluence.it.export.Exporter.AttachmentOption)

Export a site via RPC.

Parameters
rpc the rpc object
exportAttachments true for exporting attachments, false otherwise
Returns
  • a URL from which the site can be downloaded
Throws
MalformedURLException if the URL is malformed

public static URL exportSite (ConfluenceRpc rpc, Exporter.AttachmentOption attachmentOption)

Export a site via RPC.

Parameters
rpc the rpc object
attachmentOption true for exporting attachments, false otherwise
Returns
  • a URL from which the site can be downloaded
Throws
MalformedURLException if the URL is malformed

public static URL exportSpace (Space space, WebTester webTester, Exporter.ContentOption contentOption, Collection<Long> excludedPageIds)

Export a space through the web interface.

Parameters
space the target space
webTester should have the appropriate user logged in already
contentOption can be ALL, VISIBLE, or DEFAULT
excludedPageIds a collection of page IDs that should not be selected for export, others are selected by default
Returns
  • a URL from which the space can be downloaded by whatever user was logged in to the WebTester.

public static URL exportSpace (Space space, WebTester webTester, Exporter.ContentOption contentOption)

Export a space through the web interface.

Parameters
space the target space
webTester should have the appropriate user logged in already
contentOption can be ALL, VISIBLE, or DEFAULT
Returns
  • a URL from which the space can be downloaded by whatever user was logged in to the WebTester.

public static SimpleSiteStructure getSimpleSiteStructure (File file)

Return SimpleSiteStructure object useful to validate site exports in acceptance tests.

Parameters
file XML backup
Returns
  • SimpleSiteStructure
Throws
IOException if file does not exist.
Exception if it failed to create InputStream for entities.xml entry.