Merge pull request #4137 from nextcloud/renameRemote

Use new convention "xyRemoteOperation"
This commit is contained in:
Andy Scherzinger 2019-06-14 06:42:21 +02:00 committed by GitHub
commit b53018a86e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 60 additions and 63 deletions

View file

@ -40,7 +40,7 @@ import com.owncloud.android.lib.common.UserInfo;
import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.status.OwnCloudVersion; import com.owncloud.android.lib.resources.status.OwnCloudVersion;
import com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation; import com.owncloud.android.lib.resources.users.GetUserInfoRemoteOperation;
import javax.inject.Inject; import javax.inject.Inject;
@ -217,7 +217,7 @@ public class UserAccountManagerImpl implements UserAccountManager {
Account[] ocAccounts = accountManager.getAccountsByType(MainApp.getAccountType(context)); Account[] ocAccounts = accountManager.getAccountsByType(MainApp.getAccountType(context));
String userId; String userId;
String displayName; String displayName;
GetRemoteUserInfoOperation remoteUserNameOperation = new GetRemoteUserInfoOperation(); GetUserInfoRemoteOperation remoteUserNameOperation = new GetUserInfoRemoteOperation();
for (Account account : ocAccounts) { for (Account account : ocAccounts) {
String storedUserId = accountManager.getUserData(account, com.owncloud.android.lib.common.accounts.AccountUtils.Constants.KEY_USER_ID); String storedUserId = accountManager.getUserData(account, com.owncloud.android.lib.common.accounts.AccountUtils.Constants.KEY_USER_ID);

View file

@ -110,7 +110,7 @@ import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode; import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.status.OwnCloudVersion; import com.owncloud.android.lib.resources.status.OwnCloudVersion;
import com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation; import com.owncloud.android.lib.resources.users.GetUserInfoRemoteOperation;
import com.owncloud.android.operations.DetectAuthenticationMethodOperation.AuthenticationMethod; import com.owncloud.android.operations.DetectAuthenticationMethodOperation.AuthenticationMethod;
import com.owncloud.android.operations.GetServerInfoOperation; import com.owncloud.android.operations.GetServerInfoOperation;
import com.owncloud.android.services.OperationsService; import com.owncloud.android.services.OperationsService;
@ -1172,7 +1172,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
} // else nothing ; only the last check operation is considered; } // else nothing ; only the last check operation is considered;
// multiple can be started if the user amends a URL quickly // multiple can be started if the user amends a URL quickly
} else if (operation instanceof GetRemoteUserInfoOperation) { } else if (operation instanceof GetUserInfoRemoteOperation) {
onGetUserNameFinish(result); onGetUserNameFinish(result);
} }
} }

View file

@ -30,7 +30,7 @@ import com.owncloud.android.lib.common.OwnCloudCredentials;
import com.owncloud.android.lib.common.network.RedirectionPath; import com.owncloud.android.lib.common.network.RedirectionPath;
import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation; import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation;
import com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation; import com.owncloud.android.lib.resources.users.GetUserInfoRemoteOperation;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
@ -78,7 +78,7 @@ public class AuthenticatorAsyncTask extends AsyncTask<Object, Void, RemoteOpera
// Operation - get display name // Operation - get display name
if (result.isSuccess()) { if (result.isSuccess()) {
GetRemoteUserInfoOperation remoteUserNameOperation = new GetRemoteUserInfoOperation(); GetUserInfoRemoteOperation remoteUserNameOperation = new GetUserInfoRemoteOperation();
result = remoteUserNameOperation.execute(client); result = remoteUserNameOperation.execute(client);
} }

View file

@ -26,8 +26,8 @@ import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.operations.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.resources.files.FileUtils; import com.owncloud.android.lib.resources.files.FileUtils;
import com.owncloud.android.lib.resources.shares.CreateRemoteShareOperation; import com.owncloud.android.lib.resources.shares.CreateShareRemoteOperation;
import com.owncloud.android.lib.resources.shares.GetRemoteSharesForFileOperation; import com.owncloud.android.lib.resources.shares.GetSharesForFileRemoteOperation;
import com.owncloud.android.lib.resources.shares.OCShare; import com.owncloud.android.lib.resources.shares.OCShare;
import com.owncloud.android.lib.resources.shares.ShareType; import com.owncloud.android.lib.resources.shares.ShareType;
import com.owncloud.android.operations.common.SyncOperation; import com.owncloud.android.operations.common.SyncOperation;
@ -50,7 +50,7 @@ public class CreateShareViaLinkOperation extends SyncOperation {
@Override @Override
protected RemoteOperationResult run(OwnCloudClient client) { protected RemoteOperationResult run(OwnCloudClient client) {
// Check if the share link already exists // Check if the share link already exists
RemoteOperation operation = new GetRemoteSharesForFileOperation(path, false, false); RemoteOperation operation = new GetSharesForFileRemoteOperation(path, false, false);
RemoteOperationResult result = operation.execute(client); RemoteOperationResult result = operation.execute(client);
// Create public link if doesn't exist yet // Create public link if doesn't exist yet
@ -66,7 +66,7 @@ public class CreateShareViaLinkOperation extends SyncOperation {
} }
} }
if (!publicShareExists) { if (!publicShareExists) {
CreateRemoteShareOperation createOp = new CreateRemoteShareOperation( CreateShareRemoteOperation createOp = new CreateShareRemoteOperation(
path, path,
ShareType.PUBLIC_LINK, ShareType.PUBLIC_LINK,
"", "",

View file

@ -26,7 +26,7 @@ import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.lib.common.OwnCloudClient; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.resources.files.FileUtils; import com.owncloud.android.lib.resources.files.FileUtils;
import com.owncloud.android.lib.resources.shares.CreateRemoteShareOperation; import com.owncloud.android.lib.resources.shares.CreateShareRemoteOperation;
import com.owncloud.android.lib.resources.shares.OCShare; import com.owncloud.android.lib.resources.shares.OCShare;
import com.owncloud.android.lib.resources.shares.ShareType; import com.owncloud.android.lib.resources.shares.ShareType;
import com.owncloud.android.operations.common.SyncOperation; import com.owncloud.android.operations.common.SyncOperation;
@ -75,7 +75,7 @@ public class CreateShareWithShareeOperation extends SyncOperation {
@Override @Override
protected RemoteOperationResult run(OwnCloudClient client) { protected RemoteOperationResult run(OwnCloudClient client) {
CreateRemoteShareOperation operation = new CreateRemoteShareOperation( CreateShareRemoteOperation operation = new CreateShareRemoteOperation(
path, path,
shareType, shareType,
shareeName, shareeName,

View file

@ -21,7 +21,7 @@ package com.owncloud.android.operations;
import com.owncloud.android.lib.common.OwnCloudClient; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.resources.status.GetRemoteCapabilitiesOperation; import com.owncloud.android.lib.resources.status.GetCapabilitiesRemoteOperation;
import com.owncloud.android.lib.resources.status.OCCapability; import com.owncloud.android.lib.resources.status.OCCapability;
import com.owncloud.android.operations.common.SyncOperation; import com.owncloud.android.operations.common.SyncOperation;
@ -32,7 +32,7 @@ public class GetCapabilitiesOperation extends SyncOperation {
@Override @Override
protected RemoteOperationResult run(OwnCloudClient client) { protected RemoteOperationResult run(OwnCloudClient client) {
GetRemoteCapabilitiesOperation getCapabilities = new GetRemoteCapabilitiesOperation(); GetCapabilitiesRemoteOperation getCapabilities = new GetCapabilitiesRemoteOperation();
RemoteOperationResult result = getCapabilities.execute(client); RemoteOperationResult result = getCapabilities.execute(client);
if (result.isSuccess() if (result.isSuccess()

View file

@ -29,7 +29,7 @@ import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode; import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.status.GetRemoteStatusOperation; import com.owncloud.android.lib.resources.status.GetStatusRemoteOperation;
import com.owncloud.android.lib.resources.status.OwnCloudVersion; import com.owncloud.android.lib.resources.status.OwnCloudVersion;
import com.owncloud.android.operations.DetectAuthenticationMethodOperation.AuthenticationMethod; import com.owncloud.android.operations.DetectAuthenticationMethodOperation.AuthenticationMethod;
@ -75,7 +75,7 @@ public class GetServerInfoOperation extends RemoteOperation {
protected RemoteOperationResult run(OwnCloudClient client) { protected RemoteOperationResult run(OwnCloudClient client) {
// first: check the status of the server (including its version) // first: check the status of the server (including its version)
GetRemoteStatusOperation getStatus = new GetRemoteStatusOperation(mContext); GetStatusRemoteOperation getStatus = new GetStatusRemoteOperation(mContext);
RemoteOperationResult result = getStatus.execute(client); RemoteOperationResult result = getStatus.execute(client);

View file

@ -24,7 +24,7 @@ package com.owncloud.android.operations;
import com.owncloud.android.lib.common.OwnCloudClient; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.shares.GetRemoteSharesForFileOperation; import com.owncloud.android.lib.resources.shares.GetSharesForFileRemoteOperation;
import com.owncloud.android.lib.resources.shares.OCShare; import com.owncloud.android.lib.resources.shares.OCShare;
import com.owncloud.android.operations.common.SyncOperation; import com.owncloud.android.operations.common.SyncOperation;
@ -58,7 +58,7 @@ public class GetSharesForFileOperation extends SyncOperation {
@Override @Override
protected RemoteOperationResult run(OwnCloudClient client) { protected RemoteOperationResult run(OwnCloudClient client) {
GetRemoteSharesForFileOperation operation = new GetRemoteSharesForFileOperation(mPath, GetSharesForFileRemoteOperation operation = new GetSharesForFileRemoteOperation(mPath,
mReshares, mSubfiles); mReshares, mSubfiles);
RemoteOperationResult result = operation.execute(client); RemoteOperationResult result = operation.execute(client);

View file

@ -27,7 +27,7 @@ import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.UserInfo; import com.owncloud.android.lib.common.UserInfo;
import com.owncloud.android.lib.common.accounts.AccountUtils; import com.owncloud.android.lib.common.accounts.AccountUtils;
import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation; import com.owncloud.android.lib.resources.users.GetUserInfoRemoteOperation;
import com.owncloud.android.operations.common.SyncOperation; import com.owncloud.android.operations.common.SyncOperation;
/** /**
@ -52,7 +52,7 @@ public class GetUserProfileOperation extends SyncOperation {
protected RemoteOperationResult run(OwnCloudClient client) { protected RemoteOperationResult run(OwnCloudClient client) {
// get display name // get display name
GetRemoteUserInfoOperation getDisplayName = new GetRemoteUserInfoOperation(); GetUserInfoRemoteOperation getDisplayName = new GetUserInfoRemoteOperation();
RemoteOperationResult result = getDisplayName.execute(client); RemoteOperationResult result = getDisplayName.execute(client);
if (result.isSuccess()) { if (result.isSuccess()) {

View file

@ -35,7 +35,7 @@ import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.files.ReadFileRemoteOperation; import com.owncloud.android.lib.resources.files.ReadFileRemoteOperation;
import com.owncloud.android.lib.resources.files.ReadFolderRemoteOperation; import com.owncloud.android.lib.resources.files.ReadFolderRemoteOperation;
import com.owncloud.android.lib.resources.files.model.RemoteFile; import com.owncloud.android.lib.resources.files.model.RemoteFile;
import com.owncloud.android.lib.resources.shares.GetRemoteSharesForFileOperation; import com.owncloud.android.lib.resources.shares.GetSharesForFileRemoteOperation;
import com.owncloud.android.lib.resources.shares.OCShare; import com.owncloud.android.lib.resources.shares.OCShare;
import com.owncloud.android.lib.resources.shares.ShareType; import com.owncloud.android.lib.resources.shares.ShareType;
import com.owncloud.android.syncadapter.FileSyncAdapter; import com.owncloud.android.syncadapter.FileSyncAdapter;
@ -567,8 +567,8 @@ public class RefreshFolderOperation extends RemoteOperation {
RemoteOperationResult result; RemoteOperationResult result;
// remote request // remote request
GetRemoteSharesForFileOperation operation = GetSharesForFileRemoteOperation operation =
new GetRemoteSharesForFileOperation(mLocalFolder.getRemotePath(), true, true); new GetSharesForFileRemoteOperation(mLocalFolder.getRemotePath(), true, true);
result = operation.execute(client); result = operation.execute(client);
if (result.isSuccess()) { if (result.isSuccess()) {

View file

@ -30,7 +30,7 @@ import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCo
import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation; import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation;
import com.owncloud.android.lib.resources.shares.OCShare; import com.owncloud.android.lib.resources.shares.OCShare;
import com.owncloud.android.lib.resources.shares.RemoveRemoteShareOperation; import com.owncloud.android.lib.resources.shares.RemoveShareRemoteOperation;
import com.owncloud.android.lib.resources.shares.ShareType; import com.owncloud.android.lib.resources.shares.ShareType;
import com.owncloud.android.operations.common.SyncOperation; import com.owncloud.android.operations.common.SyncOperation;
@ -68,8 +68,8 @@ public class UnshareOperation extends SyncOperation {
if (share != null) { if (share != null) {
OCFile file = getStorageManager().getFileByPath(mRemotePath); OCFile file = getStorageManager().getFileByPath(mRemotePath);
RemoveRemoteShareOperation operation = RemoveShareRemoteOperation operation =
new RemoveRemoteShareOperation((int) share.getRemoteId()); new RemoveShareRemoteOperation((int) share.getRemoteId());
result = operation.execute(client); result = operation.execute(client);
if (result.isSuccess()) { if (result.isSuccess()) {

View file

@ -24,9 +24,9 @@ package com.owncloud.android.operations;
import com.owncloud.android.lib.common.OwnCloudClient; import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.operations.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.resources.shares.GetRemoteShareOperation; import com.owncloud.android.lib.resources.shares.GetShareRemoteOperation;
import com.owncloud.android.lib.resources.shares.OCShare; import com.owncloud.android.lib.resources.shares.OCShare;
import com.owncloud.android.lib.resources.shares.UpdateRemoteShareOperation; import com.owncloud.android.lib.resources.shares.UpdateShareRemoteOperation;
import com.owncloud.android.operations.common.SyncOperation; import com.owncloud.android.operations.common.SyncOperation;
@ -52,12 +52,12 @@ public class UpdateNoteForShareOperation extends SyncOperation {
return new RemoteOperationResult(RemoteOperationResult.ResultCode.SHARE_NOT_FOUND); return new RemoteOperationResult(RemoteOperationResult.ResultCode.SHARE_NOT_FOUND);
} }
UpdateRemoteShareOperation updateOperation = new UpdateRemoteShareOperation(share.getRemoteId()); UpdateShareRemoteOperation updateOperation = new UpdateShareRemoteOperation(share.getRemoteId());
updateOperation.setNote(note); updateOperation.setNote(note);
RemoteOperationResult result = updateOperation.execute(client); RemoteOperationResult result = updateOperation.execute(client);
if (result.isSuccess()) { if (result.isSuccess()) {
RemoteOperation getShareOp = new GetRemoteShareOperation(share.getRemoteId()); RemoteOperation getShareOp = new GetShareRemoteOperation(share.getRemoteId());
result = getShareOp.execute(client); result = getShareOp.execute(client);
if (result.isSuccess()) { if (result.isSuccess()) {
getStorageManager().saveShare((OCShare) result.getData().get(0)); getStorageManager().saveShare((OCShare) result.getData().get(0));

View file

@ -27,9 +27,9 @@ import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.operations.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.resources.files.FileUtils; import com.owncloud.android.lib.resources.files.FileUtils;
import com.owncloud.android.lib.resources.shares.GetRemoteShareOperation; import com.owncloud.android.lib.resources.shares.GetShareRemoteOperation;
import com.owncloud.android.lib.resources.shares.OCShare; import com.owncloud.android.lib.resources.shares.OCShare;
import com.owncloud.android.lib.resources.shares.UpdateRemoteShareOperation; import com.owncloud.android.lib.resources.shares.UpdateShareRemoteOperation;
import com.owncloud.android.operations.common.SyncOperation; import com.owncloud.android.operations.common.SyncOperation;
import lombok.Getter; import lombok.Getter;
@ -72,14 +72,14 @@ public class UpdateSharePermissionsOperation extends SyncOperation {
path = share.getPath(); path = share.getPath();
// Update remote share with password // Update remote share with password
UpdateRemoteShareOperation updateOp = new UpdateRemoteShareOperation(share.getRemoteId()); UpdateShareRemoteOperation updateOp = new UpdateShareRemoteOperation(share.getRemoteId());
updateOp.setPassword(password); updateOp.setPassword(password);
updateOp.setPermissions(permissions); updateOp.setPermissions(permissions);
updateOp.setExpirationDate(expirationDateInMillis); updateOp.setExpirationDate(expirationDateInMillis);
RemoteOperationResult result = updateOp.execute(client); RemoteOperationResult result = updateOp.execute(client);
if (result.isSuccess()) { if (result.isSuccess()) {
RemoteOperation getShareOp = new GetRemoteShareOperation(share.getRemoteId()); RemoteOperation getShareOp = new GetShareRemoteOperation(share.getRemoteId());
result = getShareOp.execute(client); result = getShareOp.execute(client);
if (result.isSuccess()) { if (result.isSuccess()) {
share = (OCShare) result.getData().get(0); share = (OCShare) result.getData().get(0);

View file

@ -25,10 +25,10 @@ import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.operations.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.resources.files.FileUtils; import com.owncloud.android.lib.resources.files.FileUtils;
import com.owncloud.android.lib.resources.shares.GetRemoteShareOperation; import com.owncloud.android.lib.resources.shares.GetShareRemoteOperation;
import com.owncloud.android.lib.resources.shares.OCShare; import com.owncloud.android.lib.resources.shares.OCShare;
import com.owncloud.android.lib.resources.shares.ShareType; import com.owncloud.android.lib.resources.shares.ShareType;
import com.owncloud.android.lib.resources.shares.UpdateRemoteShareOperation; import com.owncloud.android.lib.resources.shares.UpdateShareRemoteOperation;
import com.owncloud.android.operations.common.SyncOperation; import com.owncloud.android.operations.common.SyncOperation;
import lombok.Getter; import lombok.Getter;
@ -67,7 +67,7 @@ public class UpdateShareViaLinkOperation extends SyncOperation {
return new RemoteOperationResult(RemoteOperationResult.ResultCode.SHARE_NOT_FOUND); return new RemoteOperationResult(RemoteOperationResult.ResultCode.SHARE_NOT_FOUND);
} }
UpdateRemoteShareOperation updateOp = new UpdateRemoteShareOperation(publicShare.getRemoteId()); UpdateShareRemoteOperation updateOp = new UpdateShareRemoteOperation(publicShare.getRemoteId());
updateOp.setPassword(password); updateOp.setPassword(password);
updateOp.setExpirationDate(expirationDateInMillis); updateOp.setExpirationDate(expirationDateInMillis);
updateOp.setPublicUploadOnFolder(publicUploadOnFolder); updateOp.setPublicUploadOnFolder(publicUploadOnFolder);
@ -77,7 +77,7 @@ public class UpdateShareViaLinkOperation extends SyncOperation {
if (result.isSuccess()) { if (result.isSuccess()) {
// Retrieve updated share / save directly with password? -> no; the password is not to be saved // Retrieve updated share / save directly with password? -> no; the password is not to be saved
RemoteOperation getShareOp = new GetRemoteShareOperation(publicShare.getRemoteId()); RemoteOperation getShareOp = new GetShareRemoteOperation(publicShare.getRemoteId());
result = getShareOp.execute(client); result = getShareOp.execute(client);
if (result.isSuccess()) { if (result.isSuccess()) {
OCShare share = (OCShare) result.getData().get(0); OCShare share = (OCShare) result.getData().get(0);

View file

@ -39,7 +39,7 @@ import com.owncloud.android.R;
import com.owncloud.android.datamodel.FileDataStorageManager; import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.shares.GetRemoteShareesOperation; import com.owncloud.android.lib.resources.shares.GetShareesRemoteOperation;
import com.owncloud.android.lib.resources.shares.ShareType; import com.owncloud.android.lib.resources.shares.ShareType;
import com.owncloud.android.utils.ErrorMessageAdapter; import com.owncloud.android.utils.ErrorMessageAdapter;
@ -189,7 +189,7 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
String userQuery = lastPathSegment.toLowerCase(Locale.ROOT); String userQuery = lastPathSegment.toLowerCase(Locale.ROOT);
// request to the OC server about users and groups matching userQuery // request to the OC server about users and groups matching userQuery
GetRemoteShareesOperation searchRequest = new GetRemoteShareesOperation(userQuery, REQUESTED_PAGE, GetShareesRemoteOperation searchRequest = new GetShareesRemoteOperation(userQuery, REQUESTED_PAGE,
RESULTS_PER_PAGE); RESULTS_PER_PAGE);
RemoteOperationResult result = searchRequest.execute(account, getContext()); RemoteOperationResult result = searchRequest.execute(account, getContext());
List<JSONObject> names = new ArrayList<>(); List<JSONObject> names = new ArrayList<>();
@ -232,10 +232,10 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
item = namesIt.next(); item = namesIt.next();
dataUri = null; dataUri = null;
displayName = null; displayName = null;
String userName = item.getString(GetRemoteShareesOperation.PROPERTY_LABEL); String userName = item.getString(GetShareesRemoteOperation.PROPERTY_LABEL);
JSONObject value = item.getJSONObject(GetRemoteShareesOperation.NODE_VALUE); JSONObject value = item.getJSONObject(GetShareesRemoteOperation.NODE_VALUE);
ShareType type = ShareType.fromValue(value.getInt(GetRemoteShareesOperation.PROPERTY_SHARE_TYPE)); ShareType type = ShareType.fromValue(value.getInt(GetShareesRemoteOperation.PROPERTY_SHARE_TYPE));
String shareWith = value.getString(GetRemoteShareesOperation.PROPERTY_SHARE_WITH); String shareWith = value.getString(GetShareesRemoteOperation.PROPERTY_SHARE_WITH);
switch (type) { switch (type) {
case GROUP: case GROUP:

View file

@ -54,7 +54,7 @@ import com.owncloud.android.lib.resources.files.RestoreFileVersionRemoteOperatio
import com.owncloud.android.lib.resources.files.model.FileVersion; import com.owncloud.android.lib.resources.files.model.FileVersion;
import com.owncloud.android.lib.resources.shares.ShareType; import com.owncloud.android.lib.resources.shares.ShareType;
import com.owncloud.android.lib.resources.status.OwnCloudVersion; import com.owncloud.android.lib.resources.status.OwnCloudVersion;
import com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation; import com.owncloud.android.lib.resources.users.GetUserInfoRemoteOperation;
import com.owncloud.android.operations.CheckCurrentCredentialsOperation; import com.owncloud.android.operations.CheckCurrentCredentialsOperation;
import com.owncloud.android.operations.CopyFileOperation; import com.owncloud.android.operations.CopyFileOperation;
import com.owncloud.android.operations.CreateFolderOperation; import com.owncloud.android.operations.CreateFolderOperation;
@ -641,7 +641,7 @@ public class OperationsService extends Service {
break; break;
case ACTION_GET_USER_NAME: case ACTION_GET_USER_NAME:
operation = new GetRemoteUserInfoOperation(); operation = new GetUserInfoRemoteOperation();
break; break;
case ACTION_RENAME: case ACTION_RENAME:

View file

@ -61,7 +61,6 @@ import com.nextcloud.client.onboarding.FirstRunActivity;
import com.nextcloud.client.preferences.AppPreferences; import com.nextcloud.client.preferences.AppPreferences;
import com.owncloud.android.MainApp; import com.owncloud.android.MainApp;
import com.owncloud.android.R; import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.authentication.PassCodeManager; import com.owncloud.android.authentication.PassCodeManager;
import com.owncloud.android.datamodel.ArbitraryDataProvider; import com.owncloud.android.datamodel.ArbitraryDataProvider;
import com.owncloud.android.datamodel.ExternalLinksProvider; import com.owncloud.android.datamodel.ExternalLinksProvider;
@ -80,7 +79,7 @@ import com.owncloud.android.lib.resources.files.SearchRemoteOperation;
import com.owncloud.android.lib.resources.status.CapabilityBooleanType; import com.owncloud.android.lib.resources.status.CapabilityBooleanType;
import com.owncloud.android.lib.resources.status.OCCapability; import com.owncloud.android.lib.resources.status.OCCapability;
import com.owncloud.android.lib.resources.status.OwnCloudVersion; import com.owncloud.android.lib.resources.status.OwnCloudVersion;
import com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation; import com.owncloud.android.lib.resources.users.GetUserInfoRemoteOperation;
import com.owncloud.android.operations.GetCapabilitiesOperation; import com.owncloud.android.operations.GetCapabilitiesOperation;
import com.owncloud.android.ui.TextDrawable; import com.owncloud.android.ui.TextDrawable;
import com.owncloud.android.ui.activities.ActivitiesActivity; import com.owncloud.android.ui.activities.ActivitiesActivity;
@ -856,10 +855,10 @@ public abstract class DrawerActivity extends ToolbarActivity
* @param usedSpace the used space * @param usedSpace the used space
* @param totalSpace the total space * @param totalSpace the total space
* @param relative the percentage of space already used * @param relative the percentage of space already used
* @param quotaValue {@link GetRemoteUserInfoOperation#SPACE_UNLIMITED} or other to determinate state * @param quotaValue {@link GetUserInfoRemoteOperation#SPACE_UNLIMITED} or other to determinate state
*/ */
private void setQuotaInformation(long usedSpace, long totalSpace, int relative, long quotaValue) { private void setQuotaInformation(long usedSpace, long totalSpace, int relative, long quotaValue) {
if (GetRemoteUserInfoOperation.SPACE_UNLIMITED == quotaValue) { if (GetUserInfoRemoteOperation.SPACE_UNLIMITED == quotaValue) {
mQuotaTextPercentage.setText(String.format( mQuotaTextPercentage.setText(String.format(
getString(R.string.drawer_quota_unlimited), getString(R.string.drawer_quota_unlimited),
DisplayUtils.bytesToHumanReadable(usedSpace))); DisplayUtils.bytesToHumanReadable(usedSpace)));
@ -998,7 +997,7 @@ public abstract class DrawerActivity extends ToolbarActivity
} }
final Context context = MainApp.getAppContext(); final Context context = MainApp.getAppContext();
RemoteOperationResult result = new GetRemoteUserInfoOperation().execute(currentAccount, context); RemoteOperationResult result = new GetUserInfoRemoteOperation().execute(currentAccount, context);
if (result.isSuccess() && result.getData() != null) { if (result.isSuccess() && result.getData() != null) {
final UserInfo userInfo = (UserInfo) result.getData().get(0); final UserInfo userInfo = (UserInfo) result.getData().get(0);
@ -1013,8 +1012,8 @@ public abstract class DrawerActivity extends ToolbarActivity
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
if (quotaValue > 0 || quotaValue == GetRemoteUserInfoOperation.SPACE_UNLIMITED if (quotaValue > 0 || quotaValue == GetUserInfoRemoteOperation.SPACE_UNLIMITED
|| quotaValue == GetRemoteUserInfoOperation.QUOTA_LIMIT_INFO_NOT_AVAILABLE) { || quotaValue == GetUserInfoRemoteOperation.QUOTA_LIMIT_INFO_NOT_AVAILABLE) {
/* /*
* show quota in case * show quota in case
* it is available and calculated (> 0) or * it is available and calculated (> 0) or

View file

@ -62,7 +62,7 @@ import com.owncloud.android.lib.common.UserInfo;
import com.owncloud.android.lib.common.operations.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation; import com.owncloud.android.lib.resources.users.GetUserInfoRemoteOperation;
import com.owncloud.android.ui.events.TokenPushEvent; import com.owncloud.android.ui.events.TokenPushEvent;
import com.owncloud.android.utils.DisplayUtils; import com.owncloud.android.utils.DisplayUtils;
import com.owncloud.android.utils.PushUtils; import com.owncloud.android.utils.PushUtils;
@ -415,7 +415,7 @@ public class UserInfoActivity extends FileActivity implements Injectable {
private void fetchAndSetData() { private void fetchAndSetData() {
Thread t = new Thread(() -> { Thread t = new Thread(() -> {
RemoteOperation getRemoteUserInfoOperation = new GetRemoteUserInfoOperation(); RemoteOperation getRemoteUserInfoOperation = new GetUserInfoRemoteOperation();
RemoteOperationResult result = getRemoteUserInfoOperation.execute(account, this); RemoteOperationResult result = getRemoteUserInfoOperation.execute(account, this);
if (result.isSuccess() && result.getData() != null) { if (result.isSuccess() && result.getData() != null) {

View file

@ -25,7 +25,6 @@
package com.owncloud.android.ui.fragment; package com.owncloud.android.ui.fragment;
import android.accounts.Account; import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AuthenticatorException; import android.accounts.AuthenticatorException;
import android.accounts.OperationCanceledException; import android.accounts.OperationCanceledException;
import android.app.Activity; import android.app.Activity;
@ -56,7 +55,6 @@ import com.nextcloud.client.di.Injectable;
import com.nextcloud.client.preferences.AppPreferences; import com.nextcloud.client.preferences.AppPreferences;
import com.owncloud.android.MainApp; import com.owncloud.android.MainApp;
import com.owncloud.android.R; import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.datamodel.ArbitraryDataProvider; import com.owncloud.android.datamodel.ArbitraryDataProvider;
import com.owncloud.android.datamodel.FileDataStorageManager; import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.datamodel.OCFile;
@ -71,7 +69,7 @@ import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.e2ee.ToggleEncryptionRemoteOperation; import com.owncloud.android.lib.resources.e2ee.ToggleEncryptionRemoteOperation;
import com.owncloud.android.lib.resources.files.SearchRemoteOperation; import com.owncloud.android.lib.resources.files.SearchRemoteOperation;
import com.owncloud.android.lib.resources.files.ToggleFavoriteRemoteOperation; import com.owncloud.android.lib.resources.files.ToggleFavoriteRemoteOperation;
import com.owncloud.android.lib.resources.shares.GetRemoteSharesOperation; import com.owncloud.android.lib.resources.shares.GetSharesRemoteOperation;
import com.owncloud.android.lib.resources.status.OCCapability; import com.owncloud.android.lib.resources.status.OCCapability;
import com.owncloud.android.ui.activity.FileActivity; import com.owncloud.android.ui.activity.FileActivity;
import com.owncloud.android.ui.activity.FileDisplayActivity; import com.owncloud.android.ui.activity.FileDisplayActivity;
@ -1546,7 +1544,7 @@ public class OCFileListFragment extends ExtendedListFragment implements
remoteOperation = new SearchRemoteOperation(event.getSearchQuery(), event.getSearchType(), remoteOperation = new SearchRemoteOperation(event.getSearchQuery(), event.getSearchType(),
searchOnlyFolders); searchOnlyFolders);
} else { } else {
remoteOperation = new GetRemoteSharesOperation(); remoteOperation = new GetSharesRemoteOperation();
} }
remoteOperationAsyncTask = new AsyncTask() { remoteOperationAsyncTask = new AsyncTask() {