use of com.owncloud.android.lib.resources.status.GetCapabilitiesRemoteOperation in project android by nextcloud.
the class GetCapabilitiesOperation method run.
@Override
protected RemoteOperationResult run(OwnCloudClient client) {
final FileDataStorageManager storageManager = getStorageManager();
OCCapability currentCapability = null;
if (!storageManager.getUser().isAnonymous()) {
currentCapability = storageManager.getCapability(storageManager.getUser().getAccountName());
}
RemoteOperationResult result = new GetCapabilitiesRemoteOperation(currentCapability).execute(client);
if (result.isSuccess() && result.getData() != null && result.getData().size() > 0) {
// Read data from the result
OCCapability capability = (OCCapability) result.getData().get(0);
// Save the capabilities into database
storageManager.saveCapabilities(capability);
}
return result;
}
Aggregations