1
0
mirror of https://github.com/owncloud/android-library.git synced 2026-08-20 21:02:53 +00:00

Refactor parameter user_agent out of RemoteOperation and children

This commit is contained in:
masensio
2015-03-24 14:31:40 +01:00
parent 94ac3a93d3
commit 9990eeb7ff
29 changed files with 96 additions and 166 deletions
@@ -106,7 +106,6 @@ public class CreateRemoteShareOperation extends RemoteOperation {
post.setRequestHeader( "Content-Type",
"application/x-www-form-urlencoded; charset=utf-8"); // necessary for special characters
post.addRequestHeader(USER_AGENT_HEADER, getUserAgent());
post.addParameter(PARAM_PATH, mRemoteFilePath);
post.addParameter(PARAM_SHARE_TYPE, Integer.toString(mShareType.getValue()));
@@ -86,7 +86,6 @@ public class GetRemoteSharesForFileOperation extends RemoteOperation {
try {
// Get Method
get = new GetMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH);
get.addRequestHeader(USER_AGENT_HEADER, getUserAgent());
// Add Parameters to Get Method
get.setQueryString(new NameValuePair[] {
@@ -67,7 +67,6 @@ public class GetRemoteSharesOperation extends RemoteOperation {
try{
get = new GetMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH);
get.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE);
get.addRequestHeader(USER_AGENT_HEADER, getUserAgent());
status = client.executeMethod(get);
if(isSuccess(status)) {
String response = get.getResponseBodyAsString();
@@ -72,7 +72,6 @@ public class RemoveRemoteShareOperation extends RemoteOperation {
delete = new DeleteMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH + id);
delete.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE);
delete.addRequestHeader(USER_AGENT_HEADER, getUserAgent());
status = client.executeMethod(delete);