- localCopyPassed = true;
-
- // / perform the upload
- synchronized (mCancellationRequested) {
- if (mCancellationRequested.get()) {
- throw new OperationCancelledException();
- } else {
- mPutMethod = new PutMethod(client.getBaseUri() + WebdavUtils.encodePath(mFile.getRemotePath()));
- }
+ localCopyPassed = (result == null);
+
+ /// perform the upload
+ if ( mChunked &&
+ (new File(mFile.getStoragePath())).length() >
+ ChunkedUploadRemoteFileOperation.CHUNK_SIZE ) {
+ mUploadOperation = new ChunkedUploadRemoteFileOperation(mFile.getStoragePath(),
+ mFile.getRemotePath(), mFile.getMimetype(), mFile.getEtagInConflict());
+ } else {
+ mUploadOperation = new UploadRemoteFileOperation(mFile.getStoragePath(),
+ mFile.getRemotePath(), mFile.getMimetype(), mFile.getEtagInConflict());
+ }
+ Iterator <OnDatatransferProgressListener> listener = mDataTransferListeners.iterator();
+ while (listener.hasNext()) {
+ mUploadOperation.addDatatransferProgressListener(listener.next());
+ }
+ if (mCancellationRequested.get()) {
+ throw new OperationCancelledException();