Skip to content
This repository was archived by the owner on Apr 13, 2022. It is now read-only.

Commit 97c0a07

Browse files
committed
deleteRecursive made internal to remove
1 parent 76a9385 commit 97c0a07

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

testkit/src/main/scala/scorex/testkit/utils/FileUtils.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@ trait FileUtils {
3333
createTempDirForPrefix(prefix)
3434
}
3535

36+
/**
37+
* Recursively remove all the files and directories in `root`
38+
*/
39+
def remove(root: Path): Unit = {
3640

37-
@SuppressWarnings(Array("org.wartremover.warts.Recursion"))
38-
def deleteRecursive(dir: java.io.File): Unit = {
39-
for (file <- dir.listFiles) {
40-
if (!file.getName.startsWith(".")) {
41-
if (file.isDirectory) deleteRecursive(file)
41+
@SuppressWarnings(Array("org.wartremover.warts.Recursion"))
42+
def deleteRecursive(dir: java.io.File): Unit = {
43+
for (file <- dir.listFiles) {
44+
if (file.isDirectory){
45+
deleteRecursive(file)
46+
}
4247
file.delete()
4348
}
4449
}
45-
}
4650

47-
/**
48-
* Recursively remove all files and directories in `root`
49-
*/
50-
def remove(root: Path): Unit = {
5151
deleteRecursive(root.toFile)
5252
}
5353

0 commit comments

Comments
 (0)