mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-08 00:16:09 +00:00
OC-2678: Consider CreateShareRemoteOperation returns result!=null in exceptions
This commit is contained in:
parent
30a5eedf7e
commit
81acfb9571
@ -102,8 +102,11 @@ public class CreateShareRemoteOperation extends RemoteOperation {
|
||||
RemoteOperationResult result = null;
|
||||
int status = -1;
|
||||
|
||||
PostMethod post = null;
|
||||
|
||||
try {
|
||||
// Post Method
|
||||
PostMethod post = new PostMethod(client.getBaseUri() + ShareUtils.SHAREAPI_ROUTE);
|
||||
post = new PostMethod(client.getBaseUri() + ShareUtils.SHAREAPI_ROUTE);
|
||||
Log.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHAREAPI_ROUTE);
|
||||
|
||||
post.addParameter(PARAM_PATH, mPath);
|
||||
@ -113,7 +116,6 @@ public class CreateShareRemoteOperation extends RemoteOperation {
|
||||
post.addParameter(PARAM_PASSWORD, mPassword);
|
||||
post.addParameter(PARAM_PERMISSIONS, Integer.toString(mPermissions));
|
||||
|
||||
try {
|
||||
status = client.executeMethod(post);
|
||||
|
||||
if(isSuccess(status)) {
|
||||
@ -138,13 +140,19 @@ public class CreateShareRemoteOperation extends RemoteOperation {
|
||||
result.setData(sharesObjects);
|
||||
}
|
||||
|
||||
} else {
|
||||
result = new RemoteOperationResult(false, status, post.getResponseHeaders());
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
result = new RemoteOperationResult(e);
|
||||
Log.e(TAG, "Exception while Creating New Share", e);
|
||||
|
||||
} finally {
|
||||
if (post != null) {
|
||||
post.releaseConnection();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user