Merge pull request #5614 from nextcloud/postEncoding

Use UTF8 PostMethod everywhere
This commit is contained in:
Andy Scherzinger 2020-03-10 22:52:20 +01:00 committed by GitHub
commit e891411a56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 17 deletions

View file

@ -26,7 +26,7 @@ import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.Utf8PostMethod;
import org.json.JSONObject;
import java.util.ArrayList;
@ -52,11 +52,11 @@ public class CreateFileFromTemplateOperation extends RemoteOperation {
protected RemoteOperationResult run(OwnCloudClient client) {
RemoteOperationResult result;
PostMethod postMethod = null;
Utf8PostMethod postMethod = null;
try {
postMethod = new PostMethod(client.getBaseUri() + NEW_FROM_TEMPLATE_URL + JSON_FORMAT);
postMethod = new Utf8PostMethod(client.getBaseUri() + NEW_FROM_TEMPLATE_URL + JSON_FORMAT);
postMethod.setParameter("path", path);
postMethod.setParameter("template", String.valueOf(templateId));

View file

@ -26,7 +26,7 @@ import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.Utf8PostMethod;
import org.json.JSONObject;
import java.util.ArrayList;
@ -36,7 +36,7 @@ public class StreamMediaFileOperation extends RemoteOperation {
private static final int SYNC_READ_TIMEOUT = 40000;
private static final int SYNC_CONNECTION_TIMEOUT = 5000;
private static final String STREAM_MEDIA_URL = "/ocs/v2.php/apps/dav/api/v1/direct";
private String fileID;
// JSON node names
@ -51,10 +51,10 @@ public class StreamMediaFileOperation extends RemoteOperation {
protected RemoteOperationResult run(OwnCloudClient client) {
RemoteOperationResult result;
PostMethod postMethod = null;
Utf8PostMethod postMethod = null;
try {
postMethod = new PostMethod(client.getBaseUri() + STREAM_MEDIA_URL + JSON_FORMAT);
postMethod = new Utf8PostMethod(client.getBaseUri() + STREAM_MEDIA_URL + JSON_FORMAT);
postMethod.setParameter("fileId", fileID);
// remote request

View file

@ -67,8 +67,8 @@ import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.DeleteMethod;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.PutMethod;
import org.apache.commons.httpclient.methods.Utf8PostMethod;
import java.io.IOException;
import java.security.InvalidKeyException;
@ -343,7 +343,7 @@ public class NotificationJob extends Job {
break;
case "POST":
method = new PostMethod(actionLink);
method = new Utf8PostMethod(actionLink);
break;
case "DELETE":

View file

@ -26,7 +26,7 @@ import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.Utf8PostMethod;
import org.json.JSONObject;
/**
@ -52,10 +52,10 @@ public class RichDocumentsCreateAssetOperation extends RemoteOperation {
protected RemoteOperationResult run(OwnCloudClient client) {
RemoteOperationResult result;
PostMethod postMethod = null;
Utf8PostMethod postMethod = null;
try {
postMethod = new PostMethod(client.getBaseUri() + ASSET_URL);
postMethod = new Utf8PostMethod(client.getBaseUri() + ASSET_URL);
postMethod.setParameter(PARAMETER_PATH, path);
postMethod.setParameter(PARAMETER_FORMAT, PARAMETER_FORMAT_VALUE);

View file

@ -27,7 +27,7 @@ import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.utils.NextcloudServer;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.Utf8PostMethod;
import org.json.JSONObject;
/**
@ -60,10 +60,10 @@ public class RichDocumentsUrlOperation extends RemoteOperation {
@NextcloudServer(max = 18)
protected RemoteOperationResult run(OwnCloudClient client) {
RemoteOperationResult result;
PostMethod postMethod = null;
Utf8PostMethod postMethod = null;
try {
postMethod = new PostMethod(client.getBaseUri() + DOCUMENT_URL + JSON_FORMAT);
postMethod = new Utf8PostMethod(client.getBaseUri() + DOCUMENT_URL + JSON_FORMAT);
postMethod.setParameter(FILE_ID, fileID);
// remote request

View file

@ -14,8 +14,8 @@ import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.DeleteMethod;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.PutMethod;
import org.apache.commons.httpclient.methods.Utf8PostMethod;
import java.io.IOException;
@ -47,7 +47,7 @@ public class NotificationExecuteActionTask extends AsyncTask<Action, Void, Boole
break;
case "POST":
method = new PostMethod(action.link);
method = new Utf8PostMethod(action.link);
break;
case "DELETE":