> + 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
|