Package com.plotsquared.core.backup
Class SimpleBackupManager
java.lang.Object
com.plotsquared.core.backup.SimpleBackupManager
- All Implemented Interfaces:
BackupManager
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleBackupManager(@NonNull PlayerBackupProfileFactory playerBackupProfileFactory)SimpleBackupManager(Path backupPath, boolean automaticBackup, int backupLimit, PlayerBackupProfileFactory playerBackupProfileFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidautomaticBackup(@Nullable PlotPlayer<?> player, @NonNull Plot plot, @NonNull Runnable whenDone)This will perform an automatic backup of the plot iff the plot has an owner, automatic backups are enabled.intGet the maximum amount of backups that may be stored for a plot-owner comboGet the directory in which backups are stored@NonNull BackupProfilegetProfile(@NonNull Plot plot)Get the backup profile for a plot based on its current owner (if there is one)booleanReturns true if (potentially) destructive actions should cause PlotSquared to create automatic plot backups
-
Constructor Details
-
SimpleBackupManager
@Inject public SimpleBackupManager(@NonNull PlayerBackupProfileFactory playerBackupProfileFactory) throws Exception- Throws:
Exception
-
SimpleBackupManager
public SimpleBackupManager(Path backupPath, boolean automaticBackup, int backupLimit, PlayerBackupProfileFactory playerBackupProfileFactory)
-
-
Method Details
-
getProfile
Description copied from interface:BackupManagerGet the backup profile for a plot based on its current owner (if there is one)- Specified by:
getProfilein interfaceBackupManager- Parameters:
plot- Plot to get the backup profile for- Returns:
- Backup profile
-
automaticBackup
public void automaticBackup(@Nullable PlotPlayer<?> player, @NonNull Plot plot, @NonNull Runnable whenDone)Description copied from interface:BackupManagerThis will perform an automatic backup of the plot iff the plot has an owner, automatic backups are enabled. Otherwise it will complete immediately.- Specified by:
automaticBackupin interfaceBackupManager- Parameters:
player- Player that triggered the backupplot- Plot to perform the automatic backup onwhenDone- Action that runs when the automatic backup has been completed
-
shouldAutomaticallyBackup
public boolean shouldAutomaticallyBackup()Description copied from interface:BackupManagerReturns true if (potentially) destructive actions should cause PlotSquared to create automatic plot backups- Specified by:
shouldAutomaticallyBackupin interfaceBackupManager- Returns:
- True if automatic backups are enabled
-
getBackupPath
Description copied from interface:BackupManagerGet the directory in which backups are stored- Specified by:
getBackupPathin interfaceBackupManager- Returns:
- Backup directory path
-
getBackupLimit
public int getBackupLimit()Description copied from interface:BackupManagerGet the maximum amount of backups that may be stored for a plot-owner combo- Specified by:
getBackupLimitin interfaceBackupManager- Returns:
- Backup limit
-