Class AttachmentsPersister
java.lang.Object
com.atlassian.confluence.impl.backuprestore.restore.persisters.AttachmentsPersister
- All Implemented Interfaces:
Persister
Persists Attachment entities.
For each ContentEntityObject it checks if it is an Attachment and imports corresponding file from the zip archive
into the attachment directory.
- Since:
- 8.2.0
-
Constructor Summary
ConstructorsConstructorDescriptionAttachmentsPersister
(AttachmentDataFileSystem attachmentDataFileSystem, AttachmentDaoInternal attachmentDao, IdMapper idMapper, Callable<ZipFile> zipFile, Boolean backupAttachments) -
Method Summary
Modifier and TypeMethodDescriptionvoid
persist
(Map<ExportableEntityInfo, Collection<ImportedObjectV2>> objectsToPersistGroupedByClass) Persists attachment files in the attachments' storage (e.g.boolean
shouldPersist
(Map<ExportableEntityInfo, Collection<ImportedObjectV2>> objectsWithDatabaseIdsByClass) Checks if this persister should be executed.
-
Constructor Details
-
AttachmentsPersister
public AttachmentsPersister(AttachmentDataFileSystem attachmentDataFileSystem, AttachmentDaoInternal attachmentDao, IdMapper idMapper, Callable<ZipFile> zipFile, Boolean backupAttachments)
-
-
Method Details
-
shouldPersist
public boolean shouldPersist(Map<ExportableEntityInfo, Collection<ImportedObjectV2>> objectsWithDatabaseIdsByClass) Checks if this persister should be executed.- Specified by:
shouldPersist
in interfacePersister
- Parameters:
objectsWithDatabaseIdsByClass
- - objects to persist.- Returns:
- true if any attachment found AND the backupAttachments exportDescriptor property is true
-
persist
public void persist(Map<ExportableEntityInfo, Collection<ImportedObjectV2>> objectsToPersistGroupedByClass) throws BackupRestoreExceptionPersists attachment files in the attachments' storage (e.g. file system).- Specified by:
persist
in interfacePersister
- Parameters:
objectsToPersistGroupedByClass
- - objects to persist- Throws:
BackupRestoreException
- - thrown if it cannot access any attachment files in the archive.
-