use of com.djrapitops.plan.settings.upkeep.WatchedFile in project Plan by plan-player-analytics.
the class ServerSettingsManager method prepareFileWatcher.
private FileWatcher prepareFileWatcher() {
FileWatcher fileWatcher = new FileWatcher(files.getDataFolder(), errorLogger);
File configFile = files.getConfigFile();
fileWatcher.addToWatchlist(new WatchedFile(configFile, () -> updateConfigInDB(configFile)));
return fileWatcher;
}
use of com.djrapitops.plan.settings.upkeep.WatchedFile in project Plan by plan-player-analytics.
the class NetworkSettingManager method addFileToWatchList.
private void addFileToWatchList(FileWatcher fileWatcher, File file) {
try {
ServerUUID serverUUID = getServerUUIDFromFilename(file);
fileWatcher.addToWatchlist(new WatchedFile(file, () -> updateConfigInDB(file, serverUUID)));
} catch (IndexOutOfBoundsException | IllegalArgumentException ignore) {
/* Invalid file-name, ignored */
}
}
Aggregations