use of com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation in project android by nextcloud.
the class CheckCurrentCredentialsOperation method run.
@Override
protected RemoteOperationResult run(OwnCloudClient client) {
RemoteOperationResult result;
boolean validAccount = user.nameEquals(getStorageManager().getUser().getAccountName());
if (!validAccount) {
result = new RemoteOperationResult(new IllegalStateException("Account to validate is not the account connected to!"));
} else {
RemoteOperation check = new ExistenceCheckRemoteOperation(OCFile.ROOT_PATH, false);
result = check.execute(client);
ArrayList<Object> data = new ArrayList<>();
data.add(user.toPlatformAccount());
result.setData(data);
}
return result;
}
Aggregations