summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Munteanu2011-10-13 06:33:17 (EDT)
committerSteffen Pingel2011-10-13 06:33:17 (EDT)
commitabd2e4f8e7873e3aafc29c768b496a7762bb2632 (patch)
tree52c3688b9dd72966607101abcd132e9a6227ffad
parente69647f46f596af376bd28d907cef49b2f3b056c (diff)
downloadorg.eclipse.mylyn.commons-abd2e4f8e7873e3aafc29c768b496a7762bb2632.zip
org.eclipse.mylyn.commons-abd2e4f8e7873e3aafc29c768b496a7762bb2632.tar.gz
org.eclipse.mylyn.commons-abd2e4f8e7873e3aafc29c768b496a7762bb2632.tar.bz2
NEW - bug 360780: [soap] allow subclasses to override creation of
HttpMethod instances https://bugs.eclipse.org/bugs/show_bug.cgi?id=360780
-rw-r--r--org.eclipse.mylyn.commons.soap/src/org/eclipse/mylyn/internal/provisional/commons/soap/CommonsHttpSender.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/org.eclipse.mylyn.commons.soap/src/org/eclipse/mylyn/internal/provisional/commons/soap/CommonsHttpSender.java b/org.eclipse.mylyn.commons.soap/src/org/eclipse/mylyn/internal/provisional/commons/soap/CommonsHttpSender.java
index ae913f0..c3d5a72 100644
--- a/org.eclipse.mylyn.commons.soap/src/org/eclipse/mylyn/internal/provisional/commons/soap/CommonsHttpSender.java
+++ b/org.eclipse.mylyn.commons.soap/src/org/eclipse/mylyn/internal/provisional/commons/soap/CommonsHttpSender.java
@@ -30,6 +30,8 @@
* - added AxisHttpFault to provide additional details in case of http error
* Pawel Niewiadomski
* - fixed user agent handling (bug 288441)
+ * Robert Munteanu
+ * - allow subclasses to override creation of HttpMethod instances (bug 360780)
*/
package org.eclipse.mylyn.internal.provisional.commons.soap;
@@ -152,7 +154,7 @@ public class CommonsHttpSender extends BasicHandler {
if (posting) {
Message reqMessage = msgContext.getRequestMessage();
- method = new PostMethod(targetURL.toString());
+ method = createPostMethod(targetURL);
// set false as default, addContetInfo can overwrite
method.getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, false);
@@ -167,7 +169,7 @@ public class CommonsHttpSender extends BasicHandler {
}
((PostMethod) method).setRequestEntity(requestEntity);
} else {
- method = new GetMethod(targetURL.toString());
+ method = createGetMethod(targetURL);
addContextInfo(method, httpClient, msgContext, targetURL);
}
@@ -289,6 +291,14 @@ public class CommonsHttpSender extends BasicHandler {
// }
}
+ protected GetMethod createGetMethod(URL targetURL) {
+ return new GetMethod(targetURL.toString());
+ }
+
+ protected PostMethod createPostMethod(URL targetURL) {
+ return new PostMethod(targetURL.toString());
+ }
+
/**
* little helper function for cookies. fills up the message context with a string or an array of strings (if there
* are more than one Set-Cookie)