diff --git a/app/src/main/java/foundation/e/drive/operations/UploadFileOperation.java b/app/src/main/java/foundation/e/drive/operations/UploadFileOperation.java index d4d685d08f401af3f8e3af4d7569dbf64e3b6fb3..9f95186ca9bd6a7430b20ca06d1c897210b74a03 100644 --- a/app/src/main/java/foundation/e/drive/operations/UploadFileOperation.java +++ b/app/src/main/java/foundation/e/drive/operations/UploadFileOperation.java @@ -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 );