1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00

Revert "Changes from comments in PR#442, in oc-project"

This reverts commit 3bf858e2a7ea154e4a00e98fe95d98153b416bbf.
This commit is contained in:
masensio 2014-03-20 14:02:25 +01:00
parent 3bf858e2a7
commit 7696616a44
2 changed files with 41 additions and 64 deletions

View File

@ -101,24 +101,6 @@ public class CreateRemoteShareOperation extends RemoteOperation {
PostMethod post = null;
try {
// Check if the share link already exists
GetRemoteSharesForFileOperation operation = new GetRemoteSharesForFileOperation(mRemoteFilePath, false, false);
result = ((GetRemoteSharesForFileOperation)operation).execute(client);
if (result.isSuccess()) {
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() + ShareUtils.SHARING_LINK_TOKEN + share.getToken());
Log.d(TAG, "Build Share link= " + share.getShareLink());
result = new RemoteOperationResult(ResultCode.OK);
ArrayList<Object> sharesObjects = new ArrayList<Object>();
sharesObjects.add(share);
result.setData(sharesObjects);
}
} else {
// Post Method
post = new PostMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH);
Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHARING_API_PATH);
@ -168,8 +150,6 @@ public class CreateRemoteShareOperation extends RemoteOperation {
} else {
result = new RemoteOperationResult(false, status, post.getResponseHeaders());
}
}
} catch (Exception e) {
result = new RemoteOperationResult(e);

View File

@ -36,7 +36,4 @@ 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=";
}