From aa46f1748ed0e579d60b8d3c5be268d1a43a6757 Mon Sep 17 00:00:00 2001 From: ezTxmMC Date: Mon, 30 Dec 2024 17:30:53 +0100 Subject: [PATCH 1/3] moved todo into start scripts --- .../main/java/eu/smoothcloud/launcher/SmoothCloudLauncher.java | 1 - 1 file changed, 1 deletion(-) diff --git a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/SmoothCloudLauncher.java b/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/SmoothCloudLauncher.java index 2a3b019..1163c88 100644 --- a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/SmoothCloudLauncher.java +++ b/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/SmoothCloudLauncher.java @@ -11,7 +11,6 @@ public class SmoothCloudLauncher { private static JarLoader jarLoader; public static void main(String[] args) { - // TODO: Add check if launcher is up-to-date and if not -> update classLoader = new SmoothCloudClassLoader(); dependencyLoader = new DependencyLoader("dependencies"); dependencyLoader.loadDependencys(); From a3db0bfb067714e2c9aca3c809a495a22d4a7745 Mon Sep 17 00:00:00 2001 From: ezTxmMC Date: Mon, 30 Dec 2024 17:47:13 +0100 Subject: [PATCH 2/3] added push to smoothcloud-repo --- pom.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pom.xml b/pom.xml index a6dc1b9..d7b6cb6 100644 --- a/pom.xml +++ b/pom.xml @@ -35,6 +35,14 @@ smoothcloud-launcher + + + smoothcloud-dev + SmoothCloud Repository + https://repository.smoothcloud.eu/dev + + + 17 17 From a378fd5a83090248ff9df055173b89bc89847904 Mon Sep 17 00:00:00 2001 From: ezTxmMC Date: Mon, 30 Dec 2024 18:52:06 +0100 Subject: [PATCH 3/3] recode of dependency loading in launcher --- .../launcher/SmoothCloudLauncher.java | 30 ++++--- .../launcher/dependency/Dependency.java | 40 --------- .../dependency/DependencyHandler.java | 31 +++++++ .../launcher/dependency/DependencyLoader.java | 68 --------------- .../launcher/dependency/DependencyUtil.java | 64 -------------- .../launcher/dependency/Downloader.java | 36 -------- .../launcher/dependency/Repository.java | 16 ---- .../launcher/loader/Downloader.java | 86 +++++++++++++++++++ .../launcher/{util => loader}/JarLoader.java | 5 +- .../launcher/loader/JsonLoader.java | 55 ++++++++++++ .../eu/smoothcloud/launcher/util/Pair.java | 31 ------- 11 files changed, 194 insertions(+), 268 deletions(-) delete mode 100644 smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/Dependency.java create mode 100644 smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/DependencyHandler.java delete mode 100644 smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/DependencyLoader.java delete mode 100644 smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/DependencyUtil.java delete mode 100644 smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/Downloader.java delete mode 100644 smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/Repository.java create mode 100644 smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/loader/Downloader.java rename smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/{util => loader}/JarLoader.java (93%) create mode 100644 smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/loader/JsonLoader.java delete mode 100644 smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/util/Pair.java diff --git a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/SmoothCloudLauncher.java b/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/SmoothCloudLauncher.java index 1163c88..8d3e835 100644 --- a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/SmoothCloudLauncher.java +++ b/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/SmoothCloudLauncher.java @@ -1,30 +1,38 @@ package eu.smoothcloud.launcher; -import eu.smoothcloud.launcher.dependency.DependencyLoader; -import eu.smoothcloud.launcher.util.JarLoader; +import eu.smoothcloud.launcher.dependency.DependencyHandler; +import eu.smoothcloud.launcher.loader.JarLoader; +import eu.smoothcloud.launcher.loader.JsonLoader; -import java.nio.file.Path; +import java.io.IOException; public class SmoothCloudLauncher { private static SmoothCloudClassLoader classLoader; - private static DependencyLoader dependencyLoader; + private static DependencyHandler dependencyHandler; + private static JsonLoader jsonLoader; private static JarLoader jarLoader; - public static void main(String[] args) { + public static void main(String[] args) throws IOException { classLoader = new SmoothCloudClassLoader(); - dependencyLoader = new DependencyLoader("dependencies"); - dependencyLoader.loadDependencys(); - System.out.println("Start Node Module!"); + dependencyHandler = new DependencyHandler(); + jsonLoader = new JsonLoader("https://github.com/SmoothCloudEU/smoothcloud-manifest/raw/refs/heads/master/dependencyLoader.json"); + jsonLoader.processJsonAndDownload(); + System.out.println("Starting smoothcloud-node..."); jarLoader = new JarLoader(); - jarLoader.loadJar(Path.of("dependencies/eu.smoothcloud/smoothcloud-node-1.0.0-dev.jar"), args); + System.out.println("SMOOTHCLOUD-NODE: " + dependencyHandler.getDependencyPaths().get("smoothcloud-node")); + jarLoader.loadJar(dependencyHandler.getDependencyPaths().get("smoothcloud-node"), args); } public static SmoothCloudClassLoader getClassLoader() { return classLoader; } - public static DependencyLoader getDependencyLoader() { - return dependencyLoader; + public static DependencyHandler getDependencyHandler() { + return dependencyHandler; + } + + public static JsonLoader getJsonLoader() { + return jsonLoader; } public static JarLoader getJarLoader() { diff --git a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/Dependency.java b/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/Dependency.java deleted file mode 100644 index 038c751..0000000 --- a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/Dependency.java +++ /dev/null @@ -1,40 +0,0 @@ -package eu.smoothcloud.launcher.dependency; - -public enum Dependency { - NETTY5_ALL("io.netty", "netty5-all", "5.0.0.Alpha5", Repository.MAVEN), - LOMBOK("org.projectlombok", "lombok", "1.18.36", Repository.MAVEN), - JLINE("org.jline", "jline", "3.28.0", Repository.MAVEN), - TOMLJ("org.tomlj", "tomlj", "1.1.1", Repository.MAVEN), - JSON("org.json", "json", "20240303", Repository.MAVEN), - ANTLR4_RUNTIME("org.antlr", "antlr4-runtime", "4.11.1", Repository.MAVEN), - JAVAPOET("com.squareup", "javapoet", "1.13.0", Repository.MAVEN), - SMOOTHCLOUD_NODE("eu.smoothcloud", "smoothcloud-node", "1.0.0-dev", Repository.SMOOTHCLOUD_CDN); - - private final String groupId; - private final String artifactId; - private final String version; - private final Repository repository; - - Dependency(String groupId, String artifactId, String version, Repository repository) { - this.groupId = groupId; - this.artifactId = artifactId; - this.version = version; - this.repository = repository; - } - - public String getGroupId() { - return groupId; - } - - public String getArtifactId() { - return artifactId; - } - - public String getVersion() { - return version; - } - - public Repository getRepository() { - return repository; - } -} diff --git a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/DependencyHandler.java b/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/DependencyHandler.java new file mode 100644 index 0000000..3844343 --- /dev/null +++ b/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/DependencyHandler.java @@ -0,0 +1,31 @@ +package eu.smoothcloud.launcher.dependency; + +import java.nio.file.Path; +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class DependencyHandler { + private final Map dependencyPaths; + + public DependencyHandler() { + this.dependencyPaths = new HashMap<>(); + } + + public String buildUrl(String groupId, String artifactId, String version, String repository, String json) { + Pattern pattern = Pattern.compile("\"name\": \"" + repository + "\",\\s*\"url\": \"([^\"]+)\""); + Matcher matcher = Pattern.compile(pattern.pattern()).matcher(json); + String repoUrl = ""; + if (matcher.find()) { + repoUrl = matcher.group(1); + } + + // URL erstellen + return String.format(repoUrl, groupId.replace('.', '/'), artifactId, version, artifactId, version); + } + + public Map getDependencyPaths() { + return dependencyPaths; + } +} diff --git a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/DependencyLoader.java b/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/DependencyLoader.java deleted file mode 100644 index d70e76c..0000000 --- a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/DependencyLoader.java +++ /dev/null @@ -1,68 +0,0 @@ -package eu.smoothcloud.launcher.dependency; - -import eu.smoothcloud.launcher.SmoothCloudLauncher; - -import java.io.File; -import java.net.MalformedURLException; -import java.nio.file.Path; - -public class DependencyLoader { - private final String directory; - - public DependencyLoader(String directory) { - this.directory = directory + "/"; - } - - public void loadDependencys() { - for (Dependency dependency : Dependency.values()) { - String link = buildLink(dependency); - String dependencyDir = directory + dependency.getGroupId(); - String dependencyName = dependency.getArtifactId() + "-" + dependency.getVersion() + ".jar"; - Path path = Path.of(directory + dependency.getGroupId() + "/" + dependency.getArtifactId() + "-" + dependency.getVersion() + ".jar"); - if(new File(dependencyDir, dependencyName).exists()) { - System.out.println("Skipped " + dependencyName); - try { - SmoothCloudLauncher.getClassLoader().addURL(path.toUri().toURL()); - } catch (MalformedURLException e) { - throw new RuntimeException(e); - } - continue; - } - Downloader.download( - link, - dependencyDir, - dependencyName - ); - try { - SmoothCloudLauncher.getClassLoader().addURL(path.toUri().toURL()); - } catch (MalformedURLException e) { - throw new RuntimeException(e); - } - } - } - - public static String buildLink(Dependency dependency) { - switch (dependency.getRepository()) { - case SMOOTHCLOUD_CDN -> { - return String.format( - Repository.SMOOTHCLOUD_CDN.getLink(), - dependency.getGroupId().replace(".", "/"), - dependency.getArtifactId(), - dependency.getVersion(), - dependency.getArtifactId(), - dependency.getVersion() - ); - } - default -> { - return String.format( - Repository.MAVEN.getLink(), - dependency.getGroupId().replace(".", "/"), - dependency.getArtifactId(), - dependency.getVersion(), - dependency.getArtifactId(), - dependency.getVersion() - ); - } - } - } -} diff --git a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/DependencyUtil.java b/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/DependencyUtil.java deleted file mode 100644 index afb6781..0000000 --- a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/DependencyUtil.java +++ /dev/null @@ -1,64 +0,0 @@ -package eu.smoothcloud.launcher.dependency; - -import com.sun.tools.javac.Main; -import eu.smoothcloud.launcher.util.Pair; - -import java.io.BufferedReader; -import java.io.File; -import java.io.InputStreamReader; -import java.net.HttpURLConnection; -import java.net.URL; -import java.net.URLClassLoader; -import java.util.HashMap; -import java.util.Map; - -public class DependencyUtil { - private static final String MAIN_FOLDER = "dependencies/"; - private static final String JAR_EXTENSION = ".jar"; - private static final String MANIFEST_URL = "https://cdn.smoothcloud.eu/dependencies/manifest.json"; - - public static Map> getIntDepByManifest() { - Map> manifest = new HashMap<>(); - try { - File jarFile = new File( - MAIN_FOLDER + Dependency.JSON.getGroupId(), - Dependency.JSON.getArtifactId() + "-" + Dependency.JSON.getVersion() + JAR_EXTENSION - ); - URL jarUrl = jarFile.toURI().toURL(); - - StringBuilder jsonData = new StringBuilder(); - HttpURLConnection connection = (HttpURLConnection) new URL(MANIFEST_URL).openConnection(); - connection.setRequestMethod("GET"); - try (BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) { - String line; - while ((line = reader.readLine()) != null) { - jsonData.append(line); - } - } - - try (URLClassLoader classLoader = new URLClassLoader(new URL[] { jarUrl }, Main.class.getClassLoader())) { - Class jsonArrayClass = classLoader.loadClass("org.json.JSONArray"); - Class jsonObjectClass = classLoader.loadClass("org.json.JSONObject"); - - Object jsonArray = jsonArrayClass.getDeclaredConstructor(String.class).newInstance(jsonData.toString()); - - int length = (int) jsonArrayClass.getMethod("length").invoke(jsonArray); - for (int i = 0; i < length; i++) { - Object jsonObject = jsonArrayClass.getMethod("get", int.class).invoke(jsonArray, i); - - String groupId = (String) jsonObjectClass.getMethod("getString", String.class).invoke(jsonObject, - "groupId"); - String artifactId = (String) jsonObjectClass.getMethod("getString", String.class).invoke(jsonObject, - "artifactId"); - String version = (String) jsonObjectClass.getMethod("getString", String.class).invoke(jsonObject, - "version"); - manifest.put(groupId, new Pair<>(artifactId, version)); - } - return manifest; - } - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/Downloader.java b/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/Downloader.java deleted file mode 100644 index f5deba1..0000000 --- a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/Downloader.java +++ /dev/null @@ -1,36 +0,0 @@ -package eu.smoothcloud.launcher.dependency; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; - -public class Downloader { - - public static void download(String link, String targetDir, String targetFileName) { - File downloadDir = new File(targetDir); - if (!downloadDir.exists()) { - downloadDir.mkdirs(); - } - if (!downloadDir.isDirectory()) { - return; - } - System.out.println("Downloading " + targetFileName + "..."); - try { - BufferedInputStream input = new BufferedInputStream(new URL(link).openStream()); - FileOutputStream fileOutputStream = new FileOutputStream(new File(targetDir, targetFileName)); - byte[] dataBuffer = new byte[1024]; - int bytesRead; - int totalBytes = 0; - while ((bytesRead = input.read(dataBuffer, 0, 1024)) != -1) { - fileOutputStream.write(dataBuffer, 0, bytesRead); - totalBytes += bytesRead; - } - System.out.println("Downloaded " + targetFileName + ". " + totalBytes / 1024 + " KB"); - } catch (IOException e) { - throw new RuntimeException(e); - } - } -} diff --git a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/Repository.java b/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/Repository.java deleted file mode 100644 index 72c789f..0000000 --- a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/dependency/Repository.java +++ /dev/null @@ -1,16 +0,0 @@ -package eu.smoothcloud.launcher.dependency; - -public enum Repository { - MAVEN("https://repo1.maven.org/maven2/%s/%s/%s/%s-%s.jar"), - SMOOTHCLOUD_CDN("https://cdn.smoothcloud.eu/dependencies/%s/%s/%s/%s-%s.jar"); - - private final String link; - - Repository(String link) { - this.link = link; - } - - public String getLink() { - return link; - } -} diff --git a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/loader/Downloader.java b/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/loader/Downloader.java new file mode 100644 index 0000000..c760f30 --- /dev/null +++ b/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/loader/Downloader.java @@ -0,0 +1,86 @@ +package eu.smoothcloud.launcher.loader; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.Base64; +import java.util.Scanner; + +public class Downloader { + + public static void downloadJar(String fileUrl, String saveDir, String groupId, String artifactId, String version) throws IOException { + URL url = new URL(fileUrl); + String checkDir = "dependencies/" + groupId.replace(".", "/") + "/" + artifactId; + File checkDirFile = new File(checkDir); + String fileName = fileUrl.substring(fileUrl.lastIndexOf("/") + 1); + if (checkDirFile.exists()) { + if (checkDirFile.isDirectory()) { + if (checkDirFile.listFiles() != null && checkDirFile.listFiles().length > 0) { + boolean skip = false; + for (File file : checkDirFile.listFiles()) { + if (file.isDirectory()) { + if (file.getName().equalsIgnoreCase(version)) { + skip = true; + break; + } + return; + } + } + if (skip) { + System.out.println("Skipped " + artifactId + "."); + return; + } + System.out.println("Downloading " + artifactId + "..."); + } + } + } + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("GET"); + connection.setConnectTimeout(5000); + connection.setReadTimeout(5000); + int responseCode = connection.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_UNAUTHORIZED) { + System.out.println("Authentifizierung erforderlich."); + Scanner scanner = new Scanner(System.in); + System.out.print("Benutzername: "); + String username = scanner.nextLine(); + System.out.print("Passwort: "); + String password = scanner.nextLine(); + scanner.close(); + String auth = username + ":" + password; + String encodedAuth = Base64.getEncoder().encodeToString(auth.getBytes()); + connection.disconnect(); + connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("GET"); + connection.setRequestProperty("Authorization", "Basic " + encodedAuth); + connection.setConnectTimeout(5000); + connection.setReadTimeout(5000); + responseCode = connection.getResponseCode(); + } + if (responseCode != HttpURLConnection.HTTP_OK) { + System.out.println("Kein erfolgreicher HTTP-Code: " + responseCode); + return; + } + File saveDirectory = new File(saveDir); + if (!saveDirectory.exists()) { + if (!saveDirectory.mkdirs()) { + System.out.println("Fehler beim Erstellen des Verzeichnisses: " + saveDir); + return; + } + } + InputStream inputStream = connection.getInputStream(); + File outputFile = new File(saveDir + File.separator + fileName); + FileOutputStream outputStream = new FileOutputStream(outputFile); + byte[] buffer = new byte[4096]; + int bytesRead; + while ((bytesRead = inputStream.read(buffer)) != -1) { + outputStream.write(buffer, 0, bytesRead); + } + inputStream.close(); + outputStream.close(); + System.out.println("Downloaded " + artifactId + "."); + } +} diff --git a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/util/JarLoader.java b/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/loader/JarLoader.java similarity index 93% rename from smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/util/JarLoader.java rename to smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/loader/JarLoader.java index a6a1842..aaa99f3 100644 --- a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/util/JarLoader.java +++ b/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/loader/JarLoader.java @@ -1,4 +1,4 @@ -package eu.smoothcloud.launcher.util; +package eu.smoothcloud.launcher.loader; import eu.smoothcloud.launcher.SmoothCloudClassLoader; import eu.smoothcloud.launcher.SmoothCloudLauncher; @@ -19,7 +19,8 @@ public void loadJar(Path jarPath, String[] args) { String mainClass = mainClass(jarPath); Class clazz = Class.forName(mainClass, true, classLoader); clazz.getMethod("main", String[].class).invoke(null, new Object[]{args}); - } catch (InvocationTargetException ignored) { + } catch (InvocationTargetException e) { + throw new RuntimeException(e); } catch (IOException | ClassNotFoundException | IllegalAccessException | NoSuchMethodException e) { System.err.println("General error during JAR loading: " + e.getMessage()); diff --git a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/loader/JsonLoader.java b/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/loader/JsonLoader.java new file mode 100644 index 0000000..4cb218c --- /dev/null +++ b/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/loader/JsonLoader.java @@ -0,0 +1,55 @@ +package eu.smoothcloud.launcher.loader; + +import eu.smoothcloud.launcher.SmoothCloudLauncher; +import eu.smoothcloud.launcher.dependency.DependencyHandler; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; +import java.nio.file.Path; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class JsonLoader { + private final String json; + + public JsonLoader(String urlString) throws IOException { + URL url = new URL(urlString); + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("GET"); + connection.setConnectTimeout(5000); + connection.setReadTimeout(5000); + BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); + StringBuilder response = new StringBuilder(); + String line; + while ((line = reader.readLine()) != null) { + response.append(line); + } + reader.close(); + this.json = response.toString(); + } + + public void processJsonAndDownload() { + DependencyHandler dependencyHandler = SmoothCloudLauncher.getDependencyHandler(); + Pattern pattern = Pattern.compile("\"groupId\": \"([^\"]+)\",\\s*\"artifactId\": \"([^\"]+)\",\\s*\"version\": \"([^\"]+)\",\\s*\"repository\": \"([^\"]+)\""); + Matcher matcher = pattern.matcher(this.json); + while (matcher.find()) { + String groupId = matcher.group(1); + String artifactId = matcher.group(2); + String version = matcher.group(3); + String repository = matcher.group(4); + String url = dependencyHandler.buildUrl(groupId, artifactId, version, repository, this.json); + String saveDir = "dependencies/" + groupId.replace(".", "/") + "/" + artifactId + "/" + version + "/"; + Path path = Path.of(saveDir + artifactId + "-" + version + ".jar"); + try { + Downloader.downloadJar(url, saveDir, groupId, artifactId, version); + dependencyHandler.getDependencyPaths().put(artifactId, path); + SmoothCloudLauncher.getClassLoader().addURL(path.toUri().toURL()); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + } +} diff --git a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/util/Pair.java b/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/util/Pair.java deleted file mode 100644 index 629884a..0000000 --- a/smoothcloud-launcher/src/main/java/eu/smoothcloud/launcher/util/Pair.java +++ /dev/null @@ -1,31 +0,0 @@ -package eu.smoothcloud.launcher.util; - -public class Pair { - private KEY key; - private VALUE value; - - public Pair() { - - } - - public Pair(KEY key, VALUE value) { - this.key = key; - this.value = value; - } - - public KEY getKey() { - return key; - } - - public VALUE getValue() { - return value; - } - - public void setKey(KEY key) { - this.key = key; - } - - public void setValue(VALUE value) { - this.value = value; - } -}