Class SimpleSiteStructure
- java.lang.Object
-
- com.atlassian.confluence.it.export.SimpleSiteStructure
-
public class SimpleSiteStructure extends Object
A simple representation of an exported Confluence site providing an easy way to validate site exports in acceptance tests.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSimpleSiteStructure.AttachmentRepresentationstatic classSimpleSiteStructure.ContentRepresentationstatic interfaceSimpleSiteStructure.ExportableItemstatic classSimpleSiteStructure.IdentifiedRepresentationstatic classSimpleSiteStructure.PageRepresentationstatic classSimpleSiteStructure.SpaceRepresentationstatic classSimpleSiteStructure.UserRepresentationThe representation of a Confluence user in the export file
-
Constructor Summary
Constructors Constructor Description SimpleSiteStructure()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(SimpleSiteStructure.ExportableItem rep)voidaddAttachmentData(String name, InputStream inputStream)static SimpleSiteStructurecreateFromStream(InputStream str)Utility method to create a SimpleSiteStructure as represented by the supplied InputStream.Set<SimpleSiteStructure.AttachmentRepresentation>getAllAttachments()StringgetAttachmentData(SimpleSiteStructure.AttachmentRepresentation attachment, int version)SimpleSiteStructure.PageRepresentationgetPageFromSpaceWithTitle(String spaceKey, String title)booleanhasAnonymizedUser(String username)booleanhasPage(AbstractPageEntity page)booleanhasUserWithEmail(String username)
-
-
-
Method Detail
-
add
public void add(SimpleSiteStructure.ExportableItem rep)
- Parameters:
rep- the object to be stored in the structure.
-
getPageFromSpaceWithTitle
public SimpleSiteStructure.PageRepresentation getPageFromSpaceWithTitle(String spaceKey, String title)
- Parameters:
spaceKey- the key of the space the page is found intitle- the title of the page- Returns:
- a Page representation for the specified page in the specified space, or null if there is none.
-
hasUserWithEmail
public boolean hasUserWithEmail(String username)
-
hasAnonymizedUser
public boolean hasAnonymizedUser(String username)
-
hasPage
public boolean hasPage(AbstractPageEntity page)
-
getAllAttachments
public Set<SimpleSiteStructure.AttachmentRepresentation> getAllAttachments()
- Returns:
- all attachments found in the export
-
createFromStream
public static SimpleSiteStructure createFromStream(InputStream str) throws Exception
Utility method to create a SimpleSiteStructure as represented by the supplied InputStream.- Parameters:
str- the stream to parse.- Returns:
- the SimpleSiteStructure represented by this stream.
- Throws:
Exception
-
addAttachmentData
public void addAttachmentData(String name, InputStream inputStream) throws IOException
- Throws:
IOException
-
getAttachmentData
public String getAttachmentData(SimpleSiteStructure.AttachmentRepresentation attachment, int version)
-
-