/** * Loads the latest version of the cloud for comparison. * * @return the latest version of the cloud */ public String getNewstVersion() { return getString(DEFAULT_URL + "update/config.json", "version"); }
public void checkForUpdates() { if (!wrapperConfig.isAutoUpdate()) return; String version = webClient.getNewstVersion(); if (version != null) { if (!version.equals(CloudNetWrapper.class.getPackage().getImplementationVersion())) { System.out.println("Preparing update..."); webClient.update(version); shutdown(); } else System.out.println("No updates found!"); } else System.out.println("Failed to check for updates"); }
/** * Loads all official modules * * @return a collection containing all official plugins. */ public Collection<String> getInstallableModules() { return handleRequest(DEFAULT_URL + "modules", new TypeToken<Collection<String>>() { }.getType()); }
HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(DEFAULT_URL + "update/" + (getEnvironment() ? "CloudNet-Master.jar" : "CloudNet-Wrapper.jar")).openConnection(); httpURLConnection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11"); httpURLConnection.setUseCaches(false); Paths.get("CloudNet-" + (getEnvironment() ? "Master" : "Wrapper") + "-Update#" + version + "-" + NetworkUtils.RANDOM.nextLong() + ".jar")
public void checkForUpdates() { if (!config.isAutoUpdate()) return; String version = webClient.getNewstVersion(); if (version != null) { if (!version.equals(CloudNet.class.getPackage().getImplementationVersion())) { System.out.println("Preparing update..."); webClient.update(version); shutdown(); } else System.out.println("No updates were found!"); } else System.out.println("Failed to check for updates"); }
/** * Loads all official templates * * @return a collection containing all official templates. */ public Collection<String> getInstallableTemplates() { return handleRequest(DEFAULT_URL + "templates", new TypeToken<Collection<String>>() { }.getType()); }