Closed Aitorbp closed 5 months ago
The startsWith
function will not work with files that lack an extension for the following reason:
If we have a file called test
and we want to copy this same file to the same folder. The file will behave as follows:
“test (1)”.startsWith(“test”)
This function will return true
and therefore enter the INVALID_COPY_INTO_DESCENDANT
exception, since the prefix is the same.
The behavior with extension would be the following:
“test (1).log”.startsWith(“test.log”)
Thetest.log
prefix is not contained in the target therefore it will return false
. With a folder it has the same behavior, only instead of having an extension it has a slash /
at the end.
I remove the startsWith condition from the CopyRemoteFileOperation
class and keep this logic in the CopyFileUseCase
, where these exceptions are being handled.
Fixed
Dont merge till https://github.com/owncloud/android/pull/4295 is also approved
Related Issues
App: https://github.com/owncloud/android/issues/4222
QA