mirror of
https://github.com/apache/jclouds.git
synced 2025-02-16 06:56:45 +00:00
Prefer Files.delete(Path) over File.delete
The former throws an exception including the cause if the operation fails while the latter merely returns a boolean.
This commit is contained in:
parent
fc4b072a26
commit
000a505360
@ -18,6 +18,7 @@ package org.jclouds.filesystem.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
|
||||
/**
|
||||
* Utilities for the filesystem blobstore.
|
||||
@ -38,8 +39,6 @@ public class Utils {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!file.delete()) {
|
||||
throw new IOException("Could not delete: " + file);
|
||||
}
|
||||
Files.delete(file.toPath());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user