2020-05-09 20:05:39 +02:00
|
|
|
/*
|
2022-06-15 20:17:17 +02:00
|
|
|
* PlotSquared, a land and world management plugin for Minecraft.
|
|
|
|
* Copyright (C) IntellectualSites <https://intellectualsites.com>
|
|
|
|
* Copyright (C) IntellectualSites team and contributors
|
2020-05-09 20:05:39 +02:00
|
|
|
*
|
2022-06-15 20:17:17 +02:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2020-05-09 20:05:39 +02:00
|
|
|
*
|
2022-06-15 20:17:17 +02:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2020-05-09 20:05:39 +02:00
|
|
|
*
|
2022-06-15 20:17:17 +02:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2020-05-09 20:05:39 +02:00
|
|
|
*/
|
|
|
|
package com.plotsquared.core.backup;
|
|
|
|
|
2020-09-11 13:59:40 +02:00
|
|
|
import com.plotsquared.core.player.PlotPlayer;
|
2021-01-09 22:28:41 +01:00
|
|
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
|
|
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
2020-09-11 13:59:40 +02:00
|
|
|
|
2020-05-09 20:05:39 +02:00
|
|
|
import java.io.File;
|
|
|
|
import java.nio.file.Path;
|
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Backup profile for a plot without an owner
|
2020-05-10 14:02:25 +02:00
|
|
|
* {@inheritDoc}
|
2020-05-09 20:05:39 +02:00
|
|
|
*/
|
|
|
|
public class NullBackupProfile implements BackupProfile {
|
|
|
|
|
2021-01-09 22:28:41 +01:00
|
|
|
@Override
|
|
|
|
public @NonNull CompletableFuture<List<Backup>> listBackups() {
|
2020-05-09 20:05:39 +02:00
|
|
|
return CompletableFuture.completedFuture(Collections.emptyList());
|
|
|
|
}
|
|
|
|
|
2021-01-09 22:28:41 +01:00
|
|
|
@Override
|
|
|
|
public void destroy() {
|
2020-05-09 20:05:39 +02:00
|
|
|
}
|
|
|
|
|
2021-01-09 22:28:41 +01:00
|
|
|
@Override
|
|
|
|
public @NonNull Path getBackupDirectory() {
|
2020-05-09 20:05:39 +02:00
|
|
|
return new File(".").toPath();
|
|
|
|
}
|
|
|
|
|
2021-01-09 22:28:41 +01:00
|
|
|
@Override
|
|
|
|
public @NonNull CompletableFuture<Backup> createBackup() {
|
2020-05-10 14:02:25 +02:00
|
|
|
throw new UnsupportedOperationException("Cannot create backup of an unowned plot");
|
|
|
|
}
|
|
|
|
|
2021-01-09 22:28:41 +01:00
|
|
|
@Override
|
|
|
|
public @NonNull CompletableFuture<Void> restoreBackup(final @NonNull Backup backup, @Nullable PlotPlayer<?> player) {
|
2020-05-10 14:58:45 +02:00
|
|
|
return CompletableFuture.completedFuture(null);
|
|
|
|
}
|
|
|
|
|
2020-05-09 20:05:39 +02:00
|
|
|
}
|