fix(move): rename file after relocation

This commit is contained in:
Manuel Jenny 2021-03-16 22:49:10 +01:00
parent 8f145735ed
commit 46dbde1103
No known key found for this signature in database
GPG Key ID: 1C80FE62B2BEAA18

View File

@ -214,9 +214,12 @@ class PCloudImpl {
} }
if (source instanceof PCloudFolder) { if (source instanceof PCloudFolder) {
//TODO: check if this can be reached at all
relocationResult = client().moveFolder(source.getId(), target.getParent().getId()).execute(); relocationResult = client().moveFolder(source.getId(), target.getParent().getId()).execute();
relocationResult = client().renameFolder(relocationResult.asFolder(), target.getName()).execute();
} else { } else {
relocationResult = client().moveFile(source.getId(), target.getParent().getId()).execute(); relocationResult = client().moveFile(source.getId(), target.getParent().getId()).execute().asFile();
relocationResult = client().renameFile(relocationResult.asFile(), target.getName()).execute();
} }
idCache.remove(source); idCache.remove(source);