Class XmlBackupContainerWriter
- java.lang.Object
-
- com.atlassian.confluence.impl.backuprestore.backup.container.XmlBackupContainerWriter
-
- All Implemented Interfaces:
BackupContainerWriter
,AutoCloseable
public class XmlBackupContainerWriter extends Object implements BackupContainerWriter
This class is used to create a zip container with XML formatted backup files.- Since:
- 7.20.0
-
-
Field Summary
Fields Modifier and Type Field Description static String
ENTITIES_FILE_NAME
static String
EXPORT_DESCRIPTOR_FILE_NAME
-
Constructor Summary
Constructors Constructor Description XmlBackupContainerWriter(File outputFile, ArchiveWriter archiveWriter, AttachmentDataFileSystem attachmentDataFileSystem, PluginDataWriter pluginWriter, AttachmentDaoInternal attachmentDaoInternal)
XmlBackupContainerWriter(File outputFile, ArchiveWriter archiveWriter, AttachmentDataFileSystem attachmentDataFileSystem, PluginDataWriter pluginWriter, AttachmentDaoInternal attachmentDaoInternal, Instant currentTime)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttachments(Collection<AttachmentInfo> attachments)
void
addDescriptionProperty(String name, String value)
void
addPluginModuleData(List<? extends com.atlassian.plugin.ModuleDescriptor<BackupRestoreProvider>> moduleDescriptors)
Create the data file for a specific plugin module into the backup zip file using the module Descriptorsstatic String
calculatePathInZip(Long containerId, Long originalAttachmentId, Integer attachmentVersion)
void
close()
File
getOutputFile()
void
writeObjects(Collection<EntityObjectReadyForExport> objects)
-
-
-
Field Detail
-
EXPORT_DESCRIPTOR_FILE_NAME
public static final String EXPORT_DESCRIPTOR_FILE_NAME
- See Also:
- Constant Field Values
-
ENTITIES_FILE_NAME
public static final String ENTITIES_FILE_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
XmlBackupContainerWriter
public XmlBackupContainerWriter(File outputFile, ArchiveWriter archiveWriter, AttachmentDataFileSystem attachmentDataFileSystem, PluginDataWriter pluginWriter, AttachmentDaoInternal attachmentDaoInternal) throws BackupRestoreException
- Throws:
BackupRestoreException
-
XmlBackupContainerWriter
public XmlBackupContainerWriter(File outputFile, ArchiveWriter archiveWriter, AttachmentDataFileSystem attachmentDataFileSystem, PluginDataWriter pluginWriter, AttachmentDaoInternal attachmentDaoInternal, Instant currentTime) throws BackupRestoreException
- Throws:
BackupRestoreException
-
-
Method Detail
-
writeObjects
public void writeObjects(Collection<EntityObjectReadyForExport> objects) throws BackupRestoreException
- Specified by:
writeObjects
in interfaceBackupContainerWriter
- Throws:
BackupRestoreException
-
addAttachments
public void addAttachments(Collection<AttachmentInfo> attachments)
- Specified by:
addAttachments
in interfaceBackupContainerWriter
-
calculatePathInZip
public static String calculatePathInZip(Long containerId, Long originalAttachmentId, Integer attachmentVersion)
-
addDescriptionProperty
public void addDescriptionProperty(String name, String value) throws BackupRestoreException
- Specified by:
addDescriptionProperty
in interfaceBackupContainerWriter
- Throws:
BackupRestoreException
-
addPluginModuleData
public void addPluginModuleData(List<? extends com.atlassian.plugin.ModuleDescriptor<BackupRestoreProvider>> moduleDescriptors) throws BackupRestoreException
Create the data file for a specific plugin module into the backup zip file using the module Descriptors- Specified by:
addPluginModuleData
in interfaceBackupContainerWriter
- Parameters:
moduleDescriptors
-- Throws:
BackupRestoreException
-
close
public void close() throws BackupRestoreException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceBackupContainerWriter
- Throws:
BackupRestoreException
-
getOutputFile
public File getOutputFile()
- Specified by:
getOutputFile
in interfaceBackupContainerWriter
- Returns:
- the generated output file.
-
-