Add path filter support to PathRemover

This allows for simplifying FilePath to use PathRemover rather than duplicating logic.

Signed-off-by: Matt Sicker <boards@gmail.com>
This commit is contained in:
Matt Sicker committed 2019-01-10 13:40:17 -06:00
1 parent 301ba7af51
commit 59880c2fcd
4 files changed
+47 -19

No files matched your search

+2 -2
View File
@@ -1271,7 +1271,7 @@ public final class FilePath implements Serializable {
private static final long serialVersionUID = 1L;
@Override
public Void invoke(File f, VirtualChannel channel) throws IOException {
Util.deleteRecursive(deleting(f));
Util.deleteRecursive(fileToPath(f), path -> deleting(path.toFile()).delete());
return null;
}
}
@@ -1286,7 +1286,7 @@ public final class FilePath implements Serializable {
private static final long serialVersionUID = 1L;
@Override
public Void invoke(File f, VirtualChannel channel) throws IOException {
Util.deleteContentsRecursive(deleting(f));
Util.deleteContentsRecursive(fileToPath(f), path -> deleting(path.toFile()).delete());
return null;
}
}