RmdirCommand - ignore deleted file entries

This commit is contained in:
ThomasFok 2023-01-18 20:00:20 +00:00
parent 8ca3e27fc4
commit 931804558e

View File

@ -54,6 +54,7 @@ public class RmdirCommand extends ReadWriteDiskCommandOptions {
final String pathName = formattedDisk.getSuggestedFilename(paths[i]);
Optional<FileEntry> optEntry = directory.getFiles().stream()
.filter(entry -> entry.getFilename().equalsIgnoreCase(pathName))
.filter(entry -> !entry.isDeleted())
.findFirst();
if (optEntry.isPresent()) {