mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2024-12-28 02:32:00 +00:00
Merge pull request #97 from ThomasFok/fix/ignore_deleted_files
acx - Filter out deleted file entries
This commit is contained in:
commit
1b3a5546ec
@ -92,6 +92,7 @@ public class ImportCommand extends ReadWriteDiskCommandOptions {
|
||||
for (String dir : dirs) {
|
||||
Optional<FileEntry> fileEntry = directory.getFiles().stream()
|
||||
.filter(f -> dir.equalsIgnoreCase(f.getFilename()))
|
||||
.filter(f -> !f.isDeleted())
|
||||
.findFirst();
|
||||
Optional<DirectoryEntry> dirEntry = fileEntry
|
||||
.filter(FileEntry::isDirectory)
|
||||
|
@ -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()) {
|
||||
|
@ -56,6 +56,7 @@ public class FileUtils {
|
||||
Optional<FileEntry> targetFile = targetParent.getFiles()
|
||||
.stream()
|
||||
.filter(fileEntry -> name.equals(fileEntry.getFilename()))
|
||||
.filter(fileEntry -> !fileEntry.isDeleted())
|
||||
.findFirst();
|
||||
Optional<DirectoryEntry> targetDir = targetFile
|
||||
.filter(FileEntry::isDirectory)
|
||||
@ -89,6 +90,7 @@ public class FileUtils {
|
||||
String sanitizedName = directory.getFormattedDisk().getSuggestedFilename(sourceName);
|
||||
final Optional<FileEntry> fileEntry = directory.getFiles().stream()
|
||||
.filter(entry -> entry.getFilename().equals(sanitizedName))
|
||||
.filter(entry -> !entry.isDeleted())
|
||||
.findFirst();
|
||||
|
||||
final FileEntry targetFile;
|
||||
|
Loading…
Reference in New Issue
Block a user