projects
/
pub
/
Android
/
ownCloud.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fb482fa
)
Upload operations end in conflict if overriding a version different than the last...
author
David A. Velasco
<dvelasco@solidgear.es>
Mon, 28 Sep 2015 09:21:33 +0000
(11:21 +0200)
committer
David A. Velasco
<dvelasco@solidgear.es>
Mon, 28 Sep 2015 09:21:33 +0000
(11:21 +0200)
owncloud-android-library
patch
|
blob
|
blame
|
history
src/com/owncloud/android/files/services/FileUploader.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/operations/UploadFileOperation.java
patch
|
blob
|
blame
|
history
diff --git
a/owncloud-android-library
b/owncloud-android-library
index
092c790
..
eb4f8a7
160000
(submodule)
--- a/
owncloud-android-library
+++ b/
owncloud-android-library
@@
-1
+1
@@
-Subproject commit
092c790030ef42b34352225e9c1d8480a0e38674
+Subproject commit
eb4f8a723490a18c5a07fbdc3bf19928c49c4a10
diff --git
a/src/com/owncloud/android/files/services/FileUploader.java
b/src/com/owncloud/android/files/services/FileUploader.java
index
b22abdc
..
d6f7127
100644
(file)
--- a/
src/com/owncloud/android/files/services/FileUploader.java
+++ b/
src/com/owncloud/android/files/services/FileUploader.java
@@
-572,6
+572,9
@@
public class FileUploader extends Service
uploadResult = mCurrentUpload.execute(mUploadClient);
if (uploadResult.isSuccess()) {
saveUploadedFile();
uploadResult = mCurrentUpload.execute(mUploadClient);
if (uploadResult.isSuccess()) {
saveUploadedFile();
+
+ } else if (uploadResult.getCode() == ResultCode.SYNC_CONFLICT) {
+ mStorageManager.saveConflict(mCurrentUpload.getFile(), true);
}
} else {
uploadResult = grantResult;
}
} else {
uploadResult = grantResult;
diff --git
a/src/com/owncloud/android/operations/UploadFileOperation.java
b/src/com/owncloud/android/operations/UploadFileOperation.java
index
7fad177
..
09c4581
100644
(file)
--- a/
src/com/owncloud/android/operations/UploadFileOperation.java
+++ b/
src/com/owncloud/android/operations/UploadFileOperation.java
@@
-31,6
+31,7
@@
import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.RequestEntity;
import android.accounts.Account;
import org.apache.commons.httpclient.methods.RequestEntity;
import android.accounts.Account;
@@
-310,10
+311,10
@@
public class UploadFileOperation extends RemoteOperation {
(new File(mFile.getStoragePath())).length() >
ChunkedUploadRemoteFileOperation.CHUNK_SIZE ) {
mUploadOperation = new ChunkedUploadRemoteFileOperation(mFile.getStoragePath(),
(new File(mFile.getStoragePath())).length() >
ChunkedUploadRemoteFileOperation.CHUNK_SIZE ) {
mUploadOperation = new ChunkedUploadRemoteFileOperation(mFile.getStoragePath(),
- mFile.getRemotePath(), mFile.getMimetype());
+ mFile.getRemotePath(), mFile.getMimetype()
, mFile.getEtag()
);
} else {
mUploadOperation = new UploadRemoteFileOperation(mFile.getStoragePath(),
} else {
mUploadOperation = new UploadRemoteFileOperation(mFile.getStoragePath(),
- mFile.getRemotePath(), mFile.getMimetype());
+ mFile.getRemotePath(), mFile.getMimetype()
, mFile.getEtag()
);
}
Iterator <OnDatatransferProgressListener> listener = mDataTransferListeners.iterator();
while (listener.hasNext()) {
}
Iterator <OnDatatransferProgressListener> listener = mDataTransferListeners.iterator();
while (listener.hasNext()) {
@@
-358,6
+359,9
@@
public class UploadFileOperation extends RemoteOperation {
}
}
}
}
}
}
+
+ } else if (result.getHttpCode() == HttpStatus.SC_PRECONDITION_FAILED ) {
+ result = new RemoteOperationResult(ResultCode.CONFLICT);
}
} catch (Exception e) {
}
} catch (Exception e) {