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);
}
Aggregations