use of com.owncloud.android.operations.GetSharesForFileOperation in project android by owncloud.
the class GetShareWithUsersAsyncTask method doInBackground.
@Override
protected Pair<RemoteOperation, RemoteOperationResult> doInBackground(Object... params) {
GetSharesForFileOperation operation = null;
RemoteOperationResult result = null;
if (params != null && params.length == 3) {
OCFile file = (OCFile) params[0];
Account account = (Account) params[1];
FileDataStorageManager fileDataStorageManager = (FileDataStorageManager) params[2];
try {
// Get shares request
operation = new GetSharesForFileOperation(file.getRemotePath(), false, false);
OwnCloudAccount ocAccount = new OwnCloudAccount(account, MainApp.getAppContext());
OwnCloudClient client = OwnCloudClientManagerFactory.getDefaultSingleton().getClientFor(ocAccount, MainApp.getAppContext());
result = operation.execute(client, fileDataStorageManager);
} catch (Exception e) {
result = new RemoteOperationResult(e);
Log_OC.e(TAG, "Exception while getting shares", e);
}
} else {
result = new RemoteOperationResult(RemoteOperationResult.ResultCode.UNKNOWN_ERROR);
}
return new Pair(operation, result);
}
Aggregations