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