mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-24 16:40:25 +00:00
Fix no such file exception
This commit is contained in:
parent
89885c11b8
commit
a7a3b22dcd
1 changed files with 5 additions and 2 deletions
|
@ -158,8 +158,7 @@ public class BrowserTransferModel {
|
|||
public void transferToDownloads() throws Exception {
|
||||
List<Item> toMove;
|
||||
synchronized (items) {
|
||||
toMove =
|
||||
items.stream().filter(item -> item.downloadFinished().get()).toList();
|
||||
toMove = items.stream().filter(item -> item.downloadFinished().get()).toList();
|
||||
if (toMove.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
@ -170,6 +169,10 @@ public class BrowserTransferModel {
|
|||
var downloads = DesktopHelper.getDownloadsDirectory();
|
||||
Files.createDirectories(downloads);
|
||||
for (Path file : files) {
|
||||
if (!Files.exists(file)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var target = downloads.resolve(file.getFileName());
|
||||
// Prevent DirectoryNotEmptyException
|
||||
if (Files.exists(target) && Files.isDirectory(target)) {
|
||||
|
|
Loading…
Reference in a new issue