@Override protected RemoteOperationResult run(OwnCloudClient client) { RemoteOperationResult result; try { mPutMethod = new PutMethod( new URL(client.getUserFilesWebDavUri() + WebdavUtils.encodePath(mRemotePath))); mPutMethod.setRetryOnConnectionFailure(false); if (mCancellationRequested.get()) { // the operation was cancelled before getting it's turn to be executed in the queue of uploads result = new RemoteOperationResult<>(new OperationCancelledException()); } else { // perform the upload result = uploadFile(client); Log_OC.i(TAG, "Upload of " + mLocalPath + " to " + mRemotePath + ": " + result.getLogMessage()); } } catch (Exception e) { if (mPutMethod != null && mPutMethod.isAborted()) { result = new RemoteOperationResult<>(new OperationCancelledException()); Log_OC.e(TAG, "Upload of " + mLocalPath + " to " + mRemotePath + ": " + result.getLogMessage(), new OperationCancelledException()); } else { result = new RemoteOperationResult<>(e); Log_OC.e(TAG, "Upload of " + mLocalPath + " to " + mRemotePath + ": " + result.getLogMessage(), e); } } return result; }
result = new RemoteOperationResult<>(new OperationCancelledException()); break; } else {
if (mCancellationRequested.get()) { mGet.abort(); throw new OperationCancelledException();
result = new RemoteOperationResult(new OperationCancelledException()); result = new RemoteOperationResult(new OperationCancelledException());
if (mCancellationRequested.get()) { mGet.abort(); throw new OperationCancelledException();
return new RemoteOperationResult(new OperationCancelledException()); } catch (Exception e) { if (putMethod != null && putMethod.isAborted()) { result = new RemoteOperationResult(new OperationCancelledException());