Return-Path: X-Original-To: apmail-manifoldcf-commits-archive@www.apache.org Delivered-To: apmail-manifoldcf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3847010C1D for ; Mon, 24 Feb 2014 00:45:41 +0000 (UTC) Received: (qmail 87478 invoked by uid 500); 24 Feb 2014 00:45:40 -0000 Delivered-To: apmail-manifoldcf-commits-archive@manifoldcf.apache.org Received: (qmail 87438 invoked by uid 500); 24 Feb 2014 00:45:40 -0000 Mailing-List: contact commits-help@manifoldcf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@manifoldcf.apache.org Delivered-To: mailing list commits@manifoldcf.apache.org Received: (qmail 87427 invoked by uid 99); 24 Feb 2014 00:45:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Feb 2014 00:45:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Feb 2014 00:45:39 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3350823889BF; Mon, 24 Feb 2014 00:45:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1571121 - /manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java Date: Mon, 24 Feb 2014 00:45:19 -0000 To: commits@manifoldcf.apache.org From: kwright@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140224004519.3350823889BF@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kwright Date: Mon Feb 24 00:45:18 2014 New Revision: 1571121 URL: http://svn.apache.org/r1571121 Log: Catch content-type parse exception and deal with it locally Modified: manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java Modified: manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java?rev=1571121&r1=1571120&r2=1571121&view=diff ============================================================================== --- manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java (original) +++ manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java Mon Feb 24 00:45:18 2014 @@ -69,6 +69,7 @@ import org.apache.http.conn.ConnectTimeo import org.apache.http.client.CircularRedirectException; import org.apache.http.NoHttpResponseException; import org.apache.http.HttpException; +import org.apache.http.ParseException; import java.nio.charset.Charset; import java.util.*; @@ -4649,12 +4650,19 @@ public class WikiConnector extends org.a InputStream is = entity.getContent(); try { - ContentType contentType = ContentType.getOrDefault(entity); Charset charSet; - if (contentType == null) - charSet = UTF_8; - else - charSet = contentType.getCharset(); + try + { + ContentType contentType = ContentType.getOrDefault(entity); + if (contentType == null) + charSet = UTF_8; + else + charSet = contentType.getCharset(); + } + catch (ParseException e) + { + charSet = null; + } char[] buffer = new char[65536]; Reader r = new InputStreamReader(is,charSet); Writer w = new StringWriter();