manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r943133 - in /incubator/lcf/trunk/modules/connectors: meridio/connector/org/apache/lcf/crawler/connectors/meridio/CommonsHTTPSender.java sharepoint/connector/org/apache/lcf/crawler/connectors/sharepoint/CommonsHTTPSender.java
Date Tue, 11 May 2010 14:50:03 GMT
Author: kwright
Date: Tue May 11 14:50:02 2010
New Revision: 943133

URL: http://svn.apache.org/viewvc?rev=943133&view=rev
Log:
Add redirection capabilities to sharepoint, meridio connector transport layers.

Modified:
    incubator/lcf/trunk/modules/connectors/meridio/connector/org/apache/lcf/crawler/connectors/meridio/CommonsHTTPSender.java
    incubator/lcf/trunk/modules/connectors/sharepoint/connector/org/apache/lcf/crawler/connectors/sharepoint/CommonsHTTPSender.java

Modified: incubator/lcf/trunk/modules/connectors/meridio/connector/org/apache/lcf/crawler/connectors/meridio/CommonsHTTPSender.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/connectors/meridio/connector/org/apache/lcf/crawler/connectors/meridio/CommonsHTTPSender.java?rev=943133&r1=943132&r2=943133&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/connectors/meridio/connector/org/apache/lcf/crawler/connectors/meridio/CommonsHTTPSender.java
(original)
+++ incubator/lcf/trunk/modules/connectors/meridio/connector/org/apache/lcf/crawler/connectors/meridio/CommonsHTTPSender.java
Tue May 11 14:50:02 2010
@@ -52,6 +52,7 @@ import org.apache.commons.httpclient.met
 import org.apache.commons.httpclient.methods.RequestEntity;
 import org.apache.commons.httpclient.params.HttpMethodParams;
 import org.apache.commons.httpclient.protocol.Protocol;
+import org.apache.commons.httpclient.protocol.ProtocolFactory;
 import org.apache.commons.logging.Log;
 
 import javax.xml.soap.MimeHeader;
@@ -202,7 +203,12 @@ public class CommonsHTTPSender extends B
       // the timeout value for allocation of connections from the pool
       httpClient.getParams().setConnectionManagerTimeout(this.clientProperties.getConnectionPoolTimeout());
       // Set our protocol factory, in case there's a redirect
-      httpClient.getParams().setParameter(org.apache.commons.httpclient.params.HttpClientParams.PROTOCOL_FACTORY,configInfo.getProtocolFactory());
+      ProtocolFactory myFactory = configInfo.getProtocolFactory();
+      if (myFactory != null)
+        httpClient.getParams().setParameter(org.apache.commons.httpclient.params.HttpClientParams.PROTOCOL_FACTORY,myFactory);
+      // Allow circular redirections
+      httpClient.getParams().setParameter(org.apache.commons.httpclient.params.HttpClientParams.ALLOW_CIRCULAR_REDIRECTS,new
Boolean(true));
+
 
       HostConfiguration hostConfiguration =
         getHostConfiguration(httpClient, msgContext, targetURL, configInfo);
@@ -235,6 +241,7 @@ public class CommonsHTTPSender extends B
         method = new GetMethod(relativeTargetURL);
       }
 
+      method.setFollowRedirects(true);
 
       // The variable 'releaseMethod' is null if we no longer have to release the connection
into the pool
       // on exit from this section.  Otherwise it remains set to the method, so that all
exceptions cause

Modified: incubator/lcf/trunk/modules/connectors/sharepoint/connector/org/apache/lcf/crawler/connectors/sharepoint/CommonsHTTPSender.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/connectors/sharepoint/connector/org/apache/lcf/crawler/connectors/sharepoint/CommonsHTTPSender.java?rev=943133&r1=943132&r2=943133&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/connectors/sharepoint/connector/org/apache/lcf/crawler/connectors/sharepoint/CommonsHTTPSender.java
(original)
+++ incubator/lcf/trunk/modules/connectors/sharepoint/connector/org/apache/lcf/crawler/connectors/sharepoint/CommonsHTTPSender.java
Tue May 11 14:50:02 2010
@@ -237,6 +237,8 @@ public class CommonsHTTPSender extends B
         method = new GetMethod(relativeTargetURL);
       }
 
+      // Allow redirection
+      method.setFollowRedirects(true);
 
       // The variable 'releaseMethod' is null if we no longer have to release the connection
into the pool
       // on exit from this section.  Otherwise it remains set to the method, so that all
exceptions cause



Mime
View raw message