ibessonov commented on a change in pull request #169:
URL: https://github.com/apache/ignite-3/pull/169#discussion_r655942149
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
##########
@@ -335,4 +339,46 @@ public static ClassLoader igniteClassLoader() {
return cls;
}
+
+ /**
+ * Deletes file or directory with all sub-directories and files.
+ *
+ * @param path File or directory to delete.
+ * @return {@code true} if and only if the file or directory is
successfully deleted,
+ * {@code false} otherwise
+ */
+ public static boolean delete(Path path) {
+ if (Files.isDirectory(path)) {
+ try {
+ try (DirectoryStream<Path> stream =
Files.newDirectoryStream(path)) {
+ for (Path innerPath : stream) {
+ boolean res = delete(innerPath);
+
+ if (!res)
+ return false;
+ }
+ }
+ } catch (IOException e) {
+ return false;
+ }
+ }
+
+ if (path.toFile().getName().endsWith("jar")) {
+ try {
+ // Why do we do this?
Review comment:
Have no clue
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]