- operation = new CreateRemoteShareOperation(mPath, mShareType, mShareWith, mPublicUpload, mPassword, mPermissions);
- result = ((CreateRemoteShareOperation)operation).execute(client);
+ if (result.getData().size() > 0) {
+ OCShare share = (OCShare) result.getData().get(0);
+ // Update the link, build it with the token: server address + "/public.php?service=files&t=" + token
+ share.setShareLink(client.getBaseUri() + SHARING_LINK_TOKEN + share.getToken());
+ Log_OC.d(TAG, "Build Share link= " + share.getShareLink());
+ updateData(share);
+ } else {
+ operation = new CreateRemoteShareOperation(mPath, mShareType, mShareWith, mPublicUpload, mPassword, mPermissions);
+ result = ((CreateRemoteShareOperation)operation).execute(client);