> @@ -38,8 +43,18 @@ public static void deleteRecursively(File file) throws 
> IOException {
>              }
>           }
>        }
> -      if (!file.delete()) {
> -         throw new IOException("Could not delete: " + file);
> +
> +      /**
> +       * Java-6 Compatible version of handling non-empty directories and 
> access-denied on windows.
> +       */
> +      if(!file.delete()){
> +         if(file.isDirectory() && file.listFiles().length > 0) {
> +            deleteRecursively(file);
> +         } else {
> +            Uninterruptibles.sleepUninterruptibly(2, TimeUnit.SECONDS);
> +            if(!file.delete())
> +               file.deleteOnExit();

Why do you believe we need sleeps in our code?  Which test fails without this?

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

Reply via email to