Search in sources :

Example 11 with Template

use of de.dytanic.cloudnet.lib.server.template.Template in project CloudNet by Dytanic.

the class CloudNet method setupGroup.

/*===============================================================================================================*/
@Deprecated
public void setupGroup(ServerGroup serverGroup) {
    Path path;
    for (Template template : serverGroup.getTemplates()) {
        path = Paths.get("local/templates/" + serverGroup.getName() + NetworkUtils.SLASH_STRING + template.getName());
        if (!Files.exists(path)) {
            try {
                Files.createDirectories(path);
                Files.createDirectories(Paths.get("local/templates/" + serverGroup.getName() + NetworkUtils.SLASH_STRING + template.getName() + "/plugins"));
                FileCopy.insertData("files/server.properties", "local/templates/" + serverGroup.getName() + NetworkUtils.SLASH_STRING + template.getName() + "/server.properties");
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
    path = Paths.get("local/templates/" + serverGroup.getName() + "/globaltemplate");
    if (!Files.exists(path)) {
        try {
            Files.createDirectories(path);
            Files.createDirectories(Paths.get("local/templates/" + serverGroup.getName() + "/globaltemplate/plugins"));
            FileCopy.insertData("files/server.properties", "local/templates/" + serverGroup.getName() + "/globaltemplate/server.properties");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
Also used : Path(java.nio.file.Path) IOException(java.io.IOException) Template(de.dytanic.cloudnet.lib.server.template.Template)

Aggregations

Template (de.dytanic.cloudnet.lib.server.template.Template)11 ServiceId (de.dytanic.cloudnet.lib.service.ServiceId)5 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)5 ProxyGroup (de.dytanic.cloudnet.lib.server.ProxyGroup)3 ServerGroup (de.dytanic.cloudnet.lib.server.ServerGroup)3 Document (de.dytanic.cloudnet.lib.utility.document.Document)3 Path (java.nio.file.Path)3 ServerConfig (de.dytanic.cloudnet.lib.server.ServerConfig)2 ProxyInfo (de.dytanic.cloudnet.lib.server.info.ProxyInfo)2 ServerInfo (de.dytanic.cloudnet.lib.server.info.ServerInfo)2 LocalCloudWrapper (de.dytanic.cloudnetcore.setup.LocalCloudWrapper)2 IOException (java.io.IOException)2 HttpURLConnection (java.net.HttpURLConnection)2 URL (java.net.URL)2 URLConnection (java.net.URLConnection)2 TypeToken (com.google.gson.reflect.TypeToken)1 ConnectableAddress (de.dytanic.cloudnet.lib.ConnectableAddress)1 WrapperInfo (de.dytanic.cloudnet.lib.network.WrapperInfo)1 CloudPlayer (de.dytanic.cloudnet.lib.player.CloudPlayer)1 AutoSlot (de.dytanic.cloudnet.lib.proxylayout.AutoSlot)1