mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 09:00:26 +00:00
Check if file has been deleted during transfer
This commit is contained in:
parent
e7c7886cba
commit
a77f1b5fb6
1 changed files with 12 additions and 0 deletions
|
@ -179,6 +179,12 @@ public class BrowserFileTransferOperation {
|
|||
|
||||
AtomicLong totalSize = new AtomicLong();
|
||||
if (source.getKind() == FileKind.DIRECTORY) {
|
||||
// Source might have been deleted meanwhile
|
||||
var exists = source.getFileSystem().directoryExists(source.getPath());
|
||||
if (!exists) {
|
||||
return;
|
||||
}
|
||||
|
||||
var directoryName = FileNames.getFileName(source.getPath());
|
||||
flatFiles.put(source, directoryName);
|
||||
|
||||
|
@ -193,6 +199,12 @@ public class BrowserFileTransferOperation {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
// Source might have been deleted meanwhile
|
||||
var exists = source.getFileSystem().fileExists(source.getPath());
|
||||
if (!exists) {
|
||||
return;
|
||||
}
|
||||
|
||||
flatFiles.put(source, FileNames.getFileName(source.getPath()));
|
||||
// Recalculate as it could have been changed meanwhile
|
||||
totalSize.addAndGet(source.getFileSystem().getFileSize(source.getPath()));
|
||||
|
|
Loading…
Reference in a new issue