Package net.bnubot.util.task

Examples of net.bnubot.util.task.Task.complete()


    Task t = TaskManager.createTask("Download", num, "files");
    for(FileDownload fd : queue) {
      downloadURLNow(fd.url, fd.to, fd.sha1, fd.force);
      t.advanceProgress();
    }
    t.complete();
    queue.clear();
  }

  public static void downloadURLNow(URL url, File to, SHA1Sum sha1, boolean force) throws Exception {
    // Make sure the path to the file exists
View Full Code Here


      if(task != null)
        task.advanceProgress();
    } while(true);

    if(task != null)
      task.complete();

    os.close();
    is.close();
  }
}
View Full Code Here

    Task t = TaskManager.createTask("Initializing " + con.toShortString());
    while(!con.isInitialized()) {
      Thread.sleep(10);
      Thread.yield();
    }
    t.complete();

    Out.setThreadOutputHandler(null);
    return true;
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.