From d8fd024f2adde05ceab2cb41fdcf72d9c2a9d6f5 Mon Sep 17 00:00:00 2001 From: masensio Date: Thu, 20 Mar 2014 15:34:54 +0100 Subject: [PATCH] Changes from comments in PR#442, in oc-project --- .../lib/resources/shares/GetRemoteSharesForFileOperation.java | 4 ++++ src/com/owncloud/android/lib/resources/shares/ShareUtils.java | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/com/owncloud/android/lib/resources/shares/GetRemoteSharesForFileOperation.java b/src/com/owncloud/android/lib/resources/shares/GetRemoteSharesForFileOperation.java index 48f8a023..4457bcde 100644 --- a/src/com/owncloud/android/lib/resources/shares/GetRemoteSharesForFileOperation.java +++ b/src/com/owncloud/android/lib/resources/shares/GetRemoteSharesForFileOperation.java @@ -116,6 +116,10 @@ public class GetRemoteSharesForFileOperation extends RemoteOperation { result = new RemoteOperationResult(ResultCode.OK); ArrayList sharesObjects = new ArrayList(); for (OCShare share: mShares) { + // Build the link + if (share.getToken().length() > 0) { + share.setShareLink(client.getBaseUri() + ShareUtils.SHARING_LINK_TOKEN + share.getToken()); + } sharesObjects.add(share); } result.setData(sharesObjects); diff --git a/src/com/owncloud/android/lib/resources/shares/ShareUtils.java b/src/com/owncloud/android/lib/resources/shares/ShareUtils.java index 9e2e6b99..c30d73b3 100644 --- a/src/com/owncloud/android/lib/resources/shares/ShareUtils.java +++ b/src/com/owncloud/android/lib/resources/shares/ShareUtils.java @@ -36,4 +36,7 @@ public class ShareUtils { // OCS Route public static final String SHARING_API_PATH ="/ocs/v1.php/apps/files_sharing/api/v1/shares"; + // String to build the link with the token of a share: server address + "/public.php?service=files&t=" + token + public static final String SHARING_LINK_TOKEN = "/public.php?service=files&t="; + }