1
0
mirror of https://github.com/owncloud/android-library.git synced 2026-08-13 01:12:57 +00:00

add dav4droid support part1

This commit is contained in:
DerSchabi
2018-05-17 09:45:54 +02:00
committed by davigonz
parent 9ab1b40682
commit cd3d20db07
40 changed files with 3612 additions and 474 deletions
@@ -39,6 +39,8 @@ import com.owncloud.android.lib.common.utils.Log_OC;
import java.io.IOException;
import okhttp3.OkHttpClient;
/**
* Operation which execution involves one or several interactions with an ownCloud server.
@@ -77,6 +79,11 @@ public abstract class RemoteOperation implements Runnable {
*/
private OwnCloudClient mClient = null;
/**
* Object to interact with the remote server
*/
private OkHttpClient mHttpClient = null;
/**
* Callback object to notify about the execution of the remote operation
*/
@@ -142,6 +149,25 @@ public abstract class RemoteOperation implements Runnable {
return runOperation();
}
/**
* Synchronously executes the remote operation
*
* Do not call this method from the main thread.
*
* @param client Client object to reach an ownCloud server during the execution of
* the operation.
* @return Result of the operation.
*/
public RemoteOperationResult execute(OkHttpClient client, Context context) {
if (client == null)
throw new IllegalArgumentException("Trying to execute a remote operation with a NULL " +
"OwnCloudClient");
mHttpClient = client;
mContext = context;
return runOperation();
}
/**
* Asynchronously executes the remote operation