Test filesystem api

* Invariant tests for the File interface
* Invariant tests for reading / writing files
** Due to missing features currently ignoring CryptoFileSystem
This commit is contained in:
Markus Kreusch
2016-01-28 23:26:49 +01:00
parent bfe0a50205
commit 56fcb99248
7 changed files with 351 additions and 10 deletions

View File

@@ -77,7 +77,16 @@ public interface File extends Node, Comparable<File> {
Mover.move(this, destination);
}
/**
* <p>
* Deletes the file if it exists.
* <p>
* Does nothign if the file does not exist.
*/
default void delete() {
if (!exists()) {
return;
}
try (WritableFile writableFile = openWritable()) {
writableFile.delete();
}