public class Exporter extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Exporter.AttachmentOption |
static class |
Exporter.CommentOption |
static class |
Exporter.ContentOption |
static interface |
Exporter.ExporterFormOption |
Constructor and Description |
---|
Exporter() |
Modifier and Type | Method and Description |
---|---|
static SimpleSiteStructure |
downloadAndParseExport(URL url,
User user)
Download and parse xml backup into SimpleSiteStructure, useful to validate site exports in acceptance tests.
|
static org.dom4j.Document |
downloadAndReadExport(URL url,
User user) |
static File |
downloadExportToTemp(URL url,
User user) |
static URL |
exportSite(ConfluenceRpc rpc,
Exporter.AttachmentOption attachmentOption)
Export a site via RPC.
|
static URL |
exportSpace(Space space,
net.sourceforge.jwebunit.junit.WebTester webTester,
Collection<Long> excludedPageIds,
Exporter.ExporterFormOption... options)
Export a space through the web interface.
|
static URL |
exportSpace(Space space,
net.sourceforge.jwebunit.junit.WebTester webTester,
Exporter.ContentOption contentOption)
Export a space through the web interface.
|
static URL |
exportSpace(Space space,
net.sourceforge.jwebunit.junit.WebTester webTester,
Exporter.ContentOption contentOption,
Collection<Long> excludedPageIds)
Export a space through the web interface.
|
static SimpleHtmlSpaceExportStructure |
getSimpleHtmlExportStructure(Space space,
File htmlExportZip)
Given an export html zip, returns a structure that represents the export.
|
static SimpleSiteStructure |
getSimpleSiteStructure(File file)
Return SimpleSiteStructure object useful to validate site exports in acceptance tests.
|
public static URL exportSpace(Space space, net.sourceforge.jwebunit.junit.WebTester webTester, Collection<Long> excludedPageIds, Exporter.ExporterFormOption... options)
space
- the target spacewebTester
- should have the appropriate user logged in alreadyoptions
- any of the various Exporter.ExporterFormOption
sexcludedPageIds
- a collection of page IDs that should not be selected for export, others are selected by defaultpublic static URL exportSpace(Space space, net.sourceforge.jwebunit.junit.WebTester webTester, Exporter.ContentOption contentOption, Collection<Long> excludedPageIds)
space
- the target spacewebTester
- should have the appropriate user logged in alreadycontentOption
- can be ALL, VISIBLE, or DEFAULTexcludedPageIds
- a collection of page IDs that should not be selected for export, others are selected by defaultpublic static URL exportSpace(Space space, net.sourceforge.jwebunit.junit.WebTester webTester, Exporter.ContentOption contentOption)
space
- the target spacewebTester
- should have the appropriate user logged in alreadycontentOption
- can be ALL, VISIBLE, or DEFAULTpublic static URL exportSite(ConfluenceRpc rpc, Exporter.AttachmentOption attachmentOption) throws MalformedURLException
rpc
- the rpc objectattachmentOption
- true for exporting attachments, false otherwiseMalformedURLException
- if the URL is malformedpublic static SimpleSiteStructure downloadAndParseExport(URL url, User user) throws Exception
url
- where export can be downloadeduser
- with sufficient permission to download exportIOException
- if file does not exist in the given url.Exception
- if it failed to create InputStream for entities.xml entry.public static org.dom4j.Document downloadAndReadExport(URL url, User user) throws Exception
Exception
public static File downloadExportToTemp(URL url, User user) throws IOException
IOException
public static SimpleSiteStructure getSimpleSiteStructure(File file) throws Exception
file
- XML backupIOException
- if file does not exist.Exception
- if it failed to create InputStream for entities.xml entry.public static SimpleHtmlSpaceExportStructure getSimpleHtmlExportStructure(Space space, File htmlExportZip) throws IOException
IOException
Copyright © 2003–2016 Atlassian. All rights reserved.