MCPcopy Create free account
hub / github.com/5zig/The-5zig-Mod / downloadUpdate

Method downloadUpdate

The 5zig Mod/src/eu/the5zig/mod/I18n.java:362–373  ·  view source on GitHub ↗
(String name)

Source from the content-addressed store, hash-verified

360 }
361
362 private static void downloadUpdate(String name) {
363 try {
364 String path = "http://5zig.net/api/lang?version=" + Version.LANGVERSION + "&name=" + name;
365 File dest = new File(The5zigMod.getModDirectory(), "lang/" + Version.LANGVERSION + "/" + name);
366 The5zigMod.logger.info("Found an Update for Language File {}. Downloading from {} to {}", name, path, dest);
367 FileUtils.downloadToFile(path, dest);
368 if (currentLanguage.equals(deserialize(name.substring(0, name.length() - END.length()))))
369 loadPropertyBundle();
370 } catch (IOException e) {
371 The5zigMod.logger.error("Could not download File " + name + "!", e);
372 }
373 }
374
375 private static class LanguageJSON {
376

Callers 1

runMethod · 0.95

Calls 7

getModDirectoryMethod · 0.95
downloadToFileMethod · 0.95
deserializeMethod · 0.95
loadPropertyBundleMethod · 0.95
equalsMethod · 0.45
lengthMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected