Package org.spoutcraft.launcher.util

Examples of org.spoutcraft.launcher.util.Download


        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
      } catch (Exception e) {
      }

      ProgressSplashScreen splash = new ProgressSplashScreen();
      Download download = new Download(RestAPI.getLauncherDownloadURL(Settings.getLauncherChannel(), !codeSource.getName().endsWith(".exe")), temp.getPath());
      download.setListener(new LauncherDownloadListener(splash));
      download.run();

      ProcessBuilder processBuilder = new ProcessBuilder();
      ArrayList<String> commands = new ArrayList<String>();
      if (!codeSource.getName().endsWith(".exe")) {
        if (OperatingSystem.getOS().isWindows()) {
View Full Code Here


    this.background = background;
  }

  @Override
  protected Object doInBackground() {
    Download download = null;
    try {
      if (!backgroundImage.exists() || backgroundImage.length() < 10 * 1024 || System.currentTimeMillis() - backgroundImage.lastModified() > IMAGE_CYCLE_TIME) {
        download = new Download("http://get.spout.org/splash/random.png", backgroundImage.getPath());
        download.run();
      }
    } catch (Exception e) {
      Logger.getLogger("launcher").log(Level.WARNING, "Failed to download background image", e);
    }
    if (download != null && download.getResult() != Result.SUCCESS) {
      InputStream image = ResourceUtils.getResourceAsStream("/org/spoutcraft/launcher/resources/background.png");
      backgroundImage.delete();
      FileInputStream fis = null;
      try {
        fis = new FileInputStream(backgroundImage);
View Full Code Here

    stateChanged("Looking Up Mirrors...", 0F);

    String url = build.getSpoutcraftURL();

    if (!spoutcraft.exists()) {
      Download download = DownloadUtils.downloadFile(url, Launcher.getGameUpdater().getUpdateDir() + File.separator + "spoutcraft.jar", null, build.getMD5(), listener);
      if (download.getResult() == Result.SUCCESS) {
        Utils.copy(download.getOutFile(), spoutcraft);
      }
    }

    File libDir = new File(Launcher.getGameUpdater().getBinDir(), "lib");
    libDir.mkdir();
View Full Code Here

TOP

Related Classes of org.spoutcraft.launcher.util.Download

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.