Search in sources :

Example 1 with DirectEditingObtainRemoteOperation

use of com.nextcloud.android.lib.resources.directediting.DirectEditingObtainRemoteOperation in project android by nextcloud.

the class RefreshFolderOperation method updateDirectEditing.

private void updateDirectEditing(ArbitraryDataProvider arbitraryDataProvider, String newDirectEditingEtag) {
    RemoteOperationResult<DirectEditing> result = new DirectEditingObtainRemoteOperation().execute(user.toPlatformAccount(), mContext);
    if (result.isSuccess()) {
        DirectEditing directEditing = result.getResultData();
        String json = new Gson().toJson(directEditing);
        arbitraryDataProvider.storeOrUpdateKeyValue(user.getAccountName(), ArbitraryDataProvider.DIRECT_EDITING, json);
    } else {
        arbitraryDataProvider.deleteKeyForAccount(user.getAccountName(), ArbitraryDataProvider.DIRECT_EDITING);
    }
    arbitraryDataProvider.storeOrUpdateKeyValue(user.getAccountName(), ArbitraryDataProvider.DIRECT_EDITING_ETAG, newDirectEditingEtag);
}
Also used : DirectEditingObtainRemoteOperation(com.nextcloud.android.lib.resources.directediting.DirectEditingObtainRemoteOperation) DirectEditing(com.owncloud.android.lib.common.DirectEditing) Gson(com.google.gson.Gson)

Aggregations

Gson (com.google.gson.Gson)1 DirectEditingObtainRemoteOperation (com.nextcloud.android.lib.resources.directediting.DirectEditingObtainRemoteOperation)1 DirectEditing (com.owncloud.android.lib.common.DirectEditing)1