@@ -0,0 +1,2377 @@
+package de.skeletoneye.bungee.scale;%0A%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Path;%0Aimport java.nio.file.Paths;%0A%0Aimport org.apache.commons.io.FileUtils;%0A%0Aimport lombok.Getter;%0Aimport net.md_5.bungee.api.plugin.Plugin;%0Aimport net.md_5.bungee.config.Configuration;%0Aimport net.md_5.bungee.config.ConfigurationProvider;%0Aimport net.md_5.bungee.config.YamlConfiguration;%0A%0Apublic class BungeeScale extends Plugin%0A%7B%0A    private static @Getter BungeeScale instance;%0A%0A    // TODO To be moved somewhere else%0A    public Configuration checkConfig(Path path) throws IOException%0A    %7B%0A        if (!Files.exists(path)) %7B%0A            this.getLogger().info(%22Unable to find %22 + path.getFileName().toString() + %22, creating it.%22);%0A%0A            try (InputStream stream = this.getResourceAsStream(%22templates/%22 + path.getFileName().toString())) %7B%0A                Files.copy(stream, path);%0A            %7D%0A        %7D%0A%0A        return ConfigurationProvider.getProvider(YamlConfiguration.class).load(path.toFile());%0A    %7D%0A%0A    @Override%0A    public void onEnable()%0A    %7B%0A        try %7B%0A            // Check whether servers directory exists%0A            final Path serversDir = Paths.get(%22servers%22);%0A            Files.createDirectory(serversDir);%0A%0A            // Check whether configuration file exists and read it%0A            final Configuration networkCfg = this.checkConfig(serversDir.resolve(%22network.yml%22));%0A%0A            // Check whether other required directories exist%0A            final Path staticDir = serversDir.resolve(%22static%22);%0A            Files.createDirectory(staticDir);%0A%0A            final Path imagesDir = serversDir.resolve(%22images%22);%0A            Files.createDirectory(imagesDir);%0A%0A            final Path includesDir = serversDir.resolve(%22includes%22);%0A            Files.createDirectory(includesDir);%0A%0A            // Make sure runtime/ is existing and empty%0A            final Path runtimeDir = serversDir.resolve(%22runtime%22);%0A%0A            if (Files.exists(runtimeDir)) %7B%0A                this.getLogger().info(%22Clearing runtime directory%22);%0A                FileUtils.deleteDirectory(runtimeDir.toFile());%0A            %7D%0A%0A            Files.createDirectory(runtimeDir);%0A%0A            // Singleton%0A            BungeeScale.instance = this;%0A        %7D catch (Exception exception) %7B%0A            exception.printStackTrace();%0A        %7D%0A    %7D%0A%7D%0A

Create basic Plugin class