Class BackupService

java.lang.Object
com.pragma.archetype.domain.service.BackupService

public class BackupService extends Object
Service for backing up and restoring files during generation operations. Provides rollback capability if generation fails.
  • Constructor Details

  • Method Details

    • createBackup

      public String createBackup(Path projectPath, List<Path> filesToBackup)
      Creates a backup of the specified files before modification.
      Parameters:
      projectPath - the project root path
      filesToBackup - 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

      public void restoreBackup(Path projectPath, String backupId)
      Restores files from a backup.
      Parameters:
      projectPath - the project root path
      backupId - the backup ID returned from createBackup()
      Throws:
      BackupService.BackupException - if restore fails
    • deleteBackup

      public void deleteBackup(Path projectPath, String backupId)
      Deletes a backup after successful generation.
      Parameters:
      projectPath - the project root path
      backupId - the backup ID returned from createBackup()
      Throws:
      BackupService.BackupException - if deletion fails