Class BackupService
java.lang.Object
com.pragma.archetype.domain.service.BackupService
Service for backing up and restoring files during generation operations.
Provides rollback capability if generation fails.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classException thrown when backup operations fail. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateBackup(Path projectPath, List<Path> filesToBackup) Creates a backup of the specified files before modification.voiddeleteBackup(Path projectPath, String backupId) Deletes a backup after successful generation.voidrestoreBackup(Path projectPath, String backupId) Restores files from a backup.
-
Constructor Details
-
BackupService
-
-
Method Details
-
createBackup
Creates a backup of the specified files before modification.- Parameters:
projectPath- the project root pathfilesToBackup- list of file paths to backup (relative to project root)- Returns:
- backup ID that can be used to restore or delete the backup
- Throws:
BackupService.BackupException- if backup creation fails
-
restoreBackup
Restores files from a backup.- Parameters:
projectPath- the project root pathbackupId- the backup ID returned from createBackup()- Throws:
BackupService.BackupException- if restore fails
-
deleteBackup
Deletes a backup after successful generation.- Parameters:
projectPath- the project root pathbackupId- the backup ID returned from createBackup()- Throws:
BackupService.BackupException- if deletion fails
-