Search in sources :

Example 1 with EnableException

use of com.djrapitops.plan.exceptions.EnableException in project Plan by plan-player-analytics.

the class NetworkSettingManager method createServerSettingsFolder.

private File createServerSettingsFolder() {
    try {
        File serverConfigFolder = files.getFileFromPluginFolder("serverConfiguration");
        Path dir = serverConfigFolder.toPath();
        if (!Files.isSymbolicLink(dir))
            Files.createDirectories(dir);
        return serverConfigFolder;
    } catch (IOException e) {
        throw new EnableException("Could not initialize NetworkSettingManager: " + e.getMessage(), e);
    }
}
Also used : Path(java.nio.file.Path) EnableException(com.djrapitops.plan.exceptions.EnableException) IOException(java.io.IOException) UncheckedIOException(java.io.UncheckedIOException) WatchedFile(com.djrapitops.plan.settings.upkeep.WatchedFile) File(java.io.File)

Example 2 with EnableException

use of com.djrapitops.plan.exceptions.EnableException in project Plan by plan-player-analytics.

the class Theme method enable.

@Override
public void enable() {
    try {
        themeConfig = new ThemeConfig(files, config, logger);
        themeConfig.save();
    } catch (IOException e) {
        throw new EnableException("theme.yml could not be saved.", e);
    }
}
Also used : EnableException(com.djrapitops.plan.exceptions.EnableException) IOException(java.io.IOException)

Example 3 with EnableException

use of com.djrapitops.plan.exceptions.EnableException in project Plan by plan-player-analytics.

the class VelocityServerInfo method createServerObject.

/**
 * @throws EnableException
 */
private Server createServerObject() {
    ServerUUID serverUUID = generateNewUUID();
    String accessAddress = addresses.getAccessAddress().orElseThrow(() -> new EnableException("Velocity can not have '0.0.0.0' or '' as an address. Set up 'Server.IP' setting."));
    return new Server(-1, serverUUID, "Velocity", accessAddress, true);
}
Also used : EnableException(com.djrapitops.plan.exceptions.EnableException)

Example 4 with EnableException

use of com.djrapitops.plan.exceptions.EnableException in project Plan by plan-player-analytics.

the class BungeeServerInfo method createServerObject.

/**
 * @throws EnableException
 */
private Server createServerObject() {
    ServerUUID serverUUID = generateNewUUID();
    String accessAddress = addresses.getAccessAddress().orElseThrow(() -> new EnableException("Velocity can not have '0.0.0.0' or '' as an address. Set up 'Server.IP' setting."));
    return new Server(-1, serverUUID, "BungeeCord", accessAddress, true);
}
Also used : EnableException(com.djrapitops.plan.exceptions.EnableException)

Example 5 with EnableException

use of com.djrapitops.plan.exceptions.EnableException in project Plan by plan-player-analytics.

the class ProxyServerInfo method createServerObject.

private Server createServerObject() {
    ServerUUID serverUUID = generateNewUUID();
    String accessAddress = addresses.getAccessAddress().orElseThrow(() -> new EnableException("Velocity can not have '0.0.0.0' or '' as an address. Set up 'Server.IP' setting."));
    return new Server(-1, serverUUID, "BungeeCord", accessAddress, true);
}
Also used : ServerUUID(com.djrapitops.plan.identification.ServerUUID) EnableException(com.djrapitops.plan.exceptions.EnableException) Server(com.djrapitops.plan.identification.Server)

Aggregations

EnableException (com.djrapitops.plan.exceptions.EnableException)15 IOException (java.io.IOException)6 Server (com.djrapitops.plan.identification.Server)3 ServerUUID (com.djrapitops.plan.identification.ServerUUID)2 UncheckedIOException (java.io.UncheckedIOException)2 Path (java.nio.file.Path)2 DBInitException (com.djrapitops.plan.exceptions.database.DBInitException)1 PlanConfig (com.djrapitops.plan.settings.config.PlanConfig)1 WatchedFile (com.djrapitops.plan.settings.upkeep.WatchedFile)1 DBSystem (com.djrapitops.plan.storage.database.DBSystem)1 SQLiteDB (com.djrapitops.plan.storage.database.SQLiteDB)1 MoreExecutors (com.google.common.util.concurrent.MoreExecutors)1 File (java.io.File)1 Test (org.junit.jupiter.api.Test)1