fix: remove filename encoding

This commit is contained in:
Manuel Jenny 2021-03-25 20:49:35 +01:00
parent 6217c42440
commit c57a59c29b
No known key found for this signature in database
GPG Key ID: 1C80FE62B2BEAA18

View File

@ -224,17 +224,10 @@ class PCloudImpl {
}
};
//TODO: remove filename encoding as soon as it is fixed API wise: https://github.com/pCloud/pcloud-sdk-java/issues/13
String filename = file.getName();
String encodedFilename = URLEncoder.encode(filename, UTF_8);
try {
RemoteFile newFile = client() //
.createFile(file.getParent().getPath(), encodedFilename, pCloudDataSource, new Date(), listener, uploadOptions) //
.createFile(file.getParent().getPath(), file.getName(), pCloudDataSource, new Date(), listener, uploadOptions) //
.execute();
if (!filename.equals(encodedFilename)) {
return client().renameFile(newFile.fileId(), filename).execute();
}
return newFile;
} catch (ApiError ex) {
handleApiError(ex);