use of com.nextcloud.common.NextcloudClient in project android by nextcloud.
the class RefreshFolderOperation method updateUserProfile.
private void updateUserProfile() {
try {
NextcloudClient nextcloudClient = OwnCloudClientFactory.createNextcloudClient(user.toPlatformAccount(), mContext);
RemoteOperationResult<UserInfo> result = new GetUserProfileOperation(mStorageManager).execute(nextcloudClient);
if (!result.isSuccess()) {
Log_OC.w(TAG, "Couldn't update user profile from server");
} else {
Log_OC.i(TAG, "Got display name: " + result.getResultData());
}
} catch (AccountUtils.AccountNotFoundException | NullPointerException e) {
Log_OC.e(this, "Error updating profile", e);
}
}
use of com.nextcloud.common.NextcloudClient in project android by nextcloud.
the class RetrieveHoverCardAsyncTask method doInBackground.
@Override
protected HoverCard doInBackground(Void... voids) {
try {
NextcloudClient client = clientFactory.createNextcloudClient(user);
RemoteOperationResult<HoverCard> result = new GetHoverCardRemoteOperation(userId).execute(client);
if (result.isSuccess()) {
return result.getResultData();
} else {
return null;
}
} catch (ClientFactory.CreationException | NullPointerException e) {
return null;
}
}
use of com.nextcloud.common.NextcloudClient in project android by nextcloud.
the class RetrieveStatusAsyncTask method doInBackground.
@Override
protected com.owncloud.android.lib.resources.users.Status doInBackground(Void... voids) {
try {
NextcloudClient client = clientFactory.createNextcloudClient(user);
RemoteOperationResult<com.owncloud.android.lib.resources.users.Status> result = new GetStatusRemoteOperation().execute(client);
if (result.isSuccess()) {
return result.getResultData();
} else {
return new com.owncloud.android.lib.resources.users.Status(StatusType.OFFLINE, "", "", -1);
}
} catch (ClientFactory.CreationException | NullPointerException e) {
return new com.owncloud.android.lib.resources.users.Status(StatusType.OFFLINE, "", "", -1);
}
}
Aggregations