manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1571119 - /manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java
Date Mon, 24 Feb 2014 00:14:52 GMT
Author: kwright
Date: Mon Feb 24 00:14:51 2014
New Revision: 1571119

URL: http://svn.apache.org/r1571119
Log:
Fix CONNECTORS-901 for Web connector.

Modified:
    manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java

Modified: manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java?rev=1571119&r1=1571118&r2=1571119&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java
(original)
+++ manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java
Mon Feb 24 00:14:51 2014
@@ -31,6 +31,7 @@ import java.io.*;
 import java.net.*;
 import java.util.zip.GZIPInputStream;
 import java.util.concurrent.TimeUnit;
+import java.nio.charset.Charset;
 
 import org.apache.http.conn.ClientConnectionManager;
 import org.apache.http.client.HttpClient;
@@ -139,6 +140,8 @@ public class ThrottledFetcher
     }
   }
 
+  protected static final Charset UTF_8 = Charset.forName("UTF-8");
+
   /** Constructor.  Private since we never instantiate.
   */
   private ThrottledFetcher()
@@ -614,14 +617,7 @@ public class ThrottledFetcher
             nvps.add(new BasicNameValuePair(param,value));
           }
         }
-        try
-        {
-          postMethod.setEntity(new UrlEncodedFormEntity(nvps,HTTP.UTF_8));
-        }
-        catch (java.io.UnsupportedEncodingException e)
-        {
-          throw new ManifoldCFException("Unsupported UTF-8 encoding: "+e.getMessage(),e);
-        }
+        postMethod.setEntity(new UrlEncodedFormEntity(nvps,UTF_8));
         fetchMethod = postMethod;
         break;
       default:



Mime
View raw message