Package com.plotsquared.core.backup
Class PlayerBackupProfile
java.lang.Object
com.plotsquared.core.backup.PlayerBackupProfile
- All Implemented Interfaces:
BackupProfile
A profile associated with a player (normally a plot owner) and a
plot, which is used to store and retrieve plot backups
-
Constructor Summary
ConstructorDescriptionPlayerBackupProfile
(@NonNull UUID owner, @NonNull Plot plot, @NonNull BackupManager backupManager, @NonNull SchematicHandler schematicHandler) -
Method Summary
Modifier and TypeMethodDescriptionCreate a backup of the plot.void
destroy()
Remove all backups stored for this profileGet the directory containing the backups for this profile.Asynchronously populate a list of available backups under this profilerestoreBackup
(@NonNull Backup backup, @Nullable PlotPlayer<?> player) Restore a backup
-
Constructor Details
-
PlayerBackupProfile
@Inject public PlayerBackupProfile(@NonNull UUID owner, @NonNull Plot plot, @NonNull BackupManager backupManager, @NonNull SchematicHandler schematicHandler)
-
-
Method Details
-
listBackups
Description copied from interface:BackupProfile
Asynchronously populate a list of available backups under this profile- Specified by:
listBackups
in interfaceBackupProfile
- Returns:
- Future that will be completed with available backups
-
destroy
Description copied from interface:BackupProfile
Remove all backups stored for this profile- Specified by:
destroy
in interfaceBackupProfile
-
getBackupDirectory
Description copied from interface:BackupProfile
Get the directory containing the backups for this profile. This directory may not actually exist.- Specified by:
getBackupDirectory
in interfaceBackupProfile
- Returns:
- Folder that contains the backups for this profile
-
createBackup
Description copied from interface:BackupProfile
Create a backup of the plot. If the profile is at the maximum backup capacity, the oldest backup will be deleted.- Specified by:
createBackup
in interfaceBackupProfile
- Returns:
- Future that completes with the created backup.
-
restoreBackup
public @NonNull CompletableFuture<Void> restoreBackup(@NonNull Backup backup, @Nullable PlotPlayer<?> player) Description copied from interface:BackupProfile
Restore a backup- Specified by:
restoreBackup
in interfaceBackupProfile
- Parameters:
backup
- Backup to restoreplayer
- The player restoring the backup- Returns:
- Future that completes when the backup has finished
-