> +      Collection<File> files = FileUtils.listFiles(rootDir, 
> CanReadFileFilter.CAN_READ, TrueFileFilter.TRUE);
> +      totalBytes = FileUtils.sizeOfDirectory(rootDir);
> +
> +      System.out.println("Uploading " + rootDir.getName() + " " + 
> totalBytes/FileUtils.ONE_MB + "MB");
> +
> +      ExecutorService executor = Executors.newFixedThreadPool(numThreads);
> +
> +      for(File f : files) {
> +         BlobUploader b =
> +         new BlobUploader(
> +               (String) options.valueOf("username"),
> +               (String) options.valueOf("password"),
> +               (String) options.valueOf("provider"),
> +               (String) options.valueOf("region"),
> +               f);
> +         executor.execute(b);

It is not necessary to do that (usually there is no need to control individual 
tasks by their Future here). It might help if you are doing something with 
exception handling, but we really want these to be handled in thread or by 
jclouds.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/69/files#r22902856

Reply via email to