Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e3e6bdb authored by Aayush Gupta's avatar Aayush Gupta
Browse files

Merge branch '4853-o-fixPutRequestResultHandler' into 'v1-oreo'

Port Fix for remote folder creation when missing for file upload to v1-oreo

See merge request !99
parents d8b9b16c 874f30f0
Loading
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -148,11 +148,11 @@ public class UploadFileOperation extends RemoteOperation implements ComparableOp
            mustRestart = false;
        }else{
            //Si les répértoires ou mettre le fichier n'existe pas, on les ajoutes.
            if( uploadResult.getCode() == ResultCode.FILE_NOT_FOUND ){
                Log.d(TAG, "Catched a File not found result for : "+file.getName()+", create missing remote path then retry");
                String remoteFoldersPath = targetPath.substring( 0, targetPath.lastIndexOf(FileUtils.PATH_SEPARATOR)+1 );
                mResultCode = ResultCode.FILE_NOT_FOUND;
                CreateFolderRemoteOperation createFolderOperation = new CreateFolderRemoteOperation( remoteFoldersPath, true );
            if (uploadResult.getCode() == ResultCode.CONFLICT ) {
                mResultCode = ResultCode.CONFLICT;
                Log.d(TAG, "Catched a conflict result for : "+file.getName()+", create missing remote path then retry");
                final String remoteFolderPath = targetPath.substring(0, targetPath.lastIndexOf(FileUtils.PATH_SEPARATOR)+1 );
                final CreateFolderRemoteOperation createFolderOperation = new CreateFolderRemoteOperation(remoteFolderPath, true );
                try{
                    RemoteOperationResult createFolderResult = createFolderOperation.execute( client );