use of com.owncloud.android.lib.resources.users.GetStatusRemoteOperation 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