jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Gaul <notificati...@github.com>
Subject Re: [jclouds] Fixes tests failing on windows filesystems (#871)
Date Thu, 29 Oct 2015 00:26:33 GMT
> +      for (int n = 0; n < 10; n++) {
> +         try {
> +            Files.delete(file.toPath());
> +         } catch (DirectoryNotEmptyException dnee) {
> +            Uninterruptibles.sleepUninterruptibly(1, TimeUnit.SECONDS);
> +            continue;
> +         } catch (AccessDeniedException ade) {
> +            Uninterruptibles.sleepUninterruptibly(1, TimeUnit.SECONDS);
> +            continue;
> +         } catch (NoSuchFileException nse) {
> +            if (n == 0) throw nse;
> +            return;
> +         }
> +         return;
> +      }
> +      throw new RuntimeException("Could not delete: " + file.toPath());

Can we abstract this logic out to a method, including Javadoc explaining the motivations?
 Also it seems like we should call this helper in `removeBlob` as well.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/871/files#r43336697
Mime
View raw message