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) {
|
for (String dir : dirs) {
|
||||||
Optional<FileEntry> fileEntry = directory.getFiles().stream()
|
Optional<FileEntry> fileEntry = directory.getFiles().stream()
|
||||||
.filter(f -> dir.equalsIgnoreCase(f.getFilename()))
|
.filter(f -> dir.equalsIgnoreCase(f.getFilename()))
|
||||||
|
.filter(f -> !f.isDeleted())
|
||||||
.findFirst();
|
.findFirst();
|
||||||
Optional<DirectoryEntry> dirEntry = fileEntry
|
Optional<DirectoryEntry> dirEntry = fileEntry
|
||||||
.filter(FileEntry::isDirectory)
|
.filter(FileEntry::isDirectory)
|
||||||
|
@ -54,6 +54,7 @@ public class RmdirCommand extends ReadWriteDiskCommandOptions {
|
|||||||
final String pathName = formattedDisk.getSuggestedFilename(paths[i]);
|
final String pathName = formattedDisk.getSuggestedFilename(paths[i]);
|
||||||
Optional<FileEntry> optEntry = directory.getFiles().stream()
|
Optional<FileEntry> optEntry = directory.getFiles().stream()
|
||||||
.filter(entry -> entry.getFilename().equalsIgnoreCase(pathName))
|
.filter(entry -> entry.getFilename().equalsIgnoreCase(pathName))
|
||||||
|
.filter(entry -> !entry.isDeleted())
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
if (optEntry.isPresent()) {
|
if (optEntry.isPresent()) {
|
||||||
|
@ -56,6 +56,7 @@ public class FileUtils {
|
|||||||
Optional<FileEntry> targetFile = targetParent.getFiles()
|
Optional<FileEntry> targetFile = targetParent.getFiles()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(fileEntry -> name.equals(fileEntry.getFilename()))
|
.filter(fileEntry -> name.equals(fileEntry.getFilename()))
|
||||||
|
.filter(fileEntry -> !fileEntry.isDeleted())
|
||||||
.findFirst();
|
.findFirst();
|
||||||
Optional<DirectoryEntry> targetDir = targetFile
|
Optional<DirectoryEntry> targetDir = targetFile
|
||||||
.filter(FileEntry::isDirectory)
|
.filter(FileEntry::isDirectory)
|
||||||
@ -89,6 +90,7 @@ public class FileUtils {
|
|||||||
String sanitizedName = directory.getFormattedDisk().getSuggestedFilename(sourceName);
|
String sanitizedName = directory.getFormattedDisk().getSuggestedFilename(sourceName);
|
||||||
final Optional<FileEntry> fileEntry = directory.getFiles().stream()
|
final Optional<FileEntry> fileEntry = directory.getFiles().stream()
|
||||||
.filter(entry -> entry.getFilename().equals(sanitizedName))
|
.filter(entry -> entry.getFilename().equals(sanitizedName))
|
||||||
|
.filter(entry -> !entry.isDeleted())
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
final FileEntry targetFile;
|
final FileEntry targetFile;
|
||||||
|
Loading…
Reference in New Issue
Block a user