manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iori...@apache.org
Subject svn commit: r1588591 [1/2] - in /manifoldcf/trunk: ./ connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/email/ connector...
Date Fri, 18 Apr 2014 23:21:24 GMT
Author: iorixxx
Date: Fri Apr 18 23:21:23 2014
New Revision: 1588591

URL: http://svn.apache.org/r1588591
Log:
CONNECTORS-932 : Avoid UnsupportedEncodingException handling

Added:
    manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/util/URLDecoder.java   (with props)
    manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/util/URLEncoder.java   (with props)
Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnection.java
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchDelete.java
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java
    manifoldcf/trunk/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/email/EmailConnector.java
    manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java
    manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java
    manifoldcf/trunk/connectors/generic/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/generic/GenericAuthority.java
    manifoldcf/trunk/connectors/generic/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/generic/GenericConnector.java
    manifoldcf/trunk/connectors/gts/connector/src/main/java/org/apache/manifoldcf/agents/output/gts/HttpPoster.java
    manifoldcf/trunk/connectors/hdfs/connector/src/main/java/org/apache/manifoldcf/agents/output/hdfs/HDFSOutputConnector.java
    manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java
    manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jira/JiraSession.java
    manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraSession.java
    manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
    manifoldcf/trunk/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnection.java
    manifoldcf/trunk/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnector.java
    manifoldcf/trunk/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerDelete.java
    manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/RSSConnector.java
    manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/sharepoint/SharePointADAuthority.java
    manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/sharepoint/SharePointAuthority.java
    manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
    manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
    manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/ModifiedHttpSolrServer.java
    manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/ThrottledFetcher.java
    manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java
    manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/common/XMLFileContext.java
    manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/common/XMLOutputStreamContext.java
    manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/common/XMLWriterContext.java
    manifoldcf/trunk/framework/api-servlet/src/main/java/org/apache/manifoldcf/apiservlet/APIServlet.java
    manifoldcf/trunk/framework/authority-servlet/src/main/java/org/apache/manifoldcf/authorityservlet/UserACLServlet.java
    manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/fuzzyml/XMLFileParsingContext.java
    manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/fuzzyml/XMLOutputStreamParsingContext.java
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/error.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listauthorities.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listconnections.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listgroups.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listmappers.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listoutputs.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewauthority.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewconnection.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewgroup.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewmapper.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewoutput.jsp
    manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/WorkerThread.java
    manifoldcf/trunk/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConnectionName.java
    manifoldcf/trunk/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableQueryArg.java
    manifoldcf/trunk/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableString.java

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Fri Apr 18 23:21:23 2014
@@ -3,6 +3,9 @@ $Id$
 
 ======================= 1.7-dev =====================
 
+CONNECTORS-932 : Avoid UnsupportedEncodingException handling
+(Ahmet Arslan)
+
 CONNECTORS-927: Override JDK's entity expansion limit for Solr
 connector.
 (David Morana, Karl Wright)

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnection.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnection.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnection.java (original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnection.java Fri Apr 18 23:21:23 2014
@@ -20,14 +20,12 @@
 package org.apache.manifoldcf.agents.output.elasticsearch;
 
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.io.Writer;
 import java.io.StringWriter;
 import java.io.Reader;
 import java.io.InputStreamReader;
 import java.io.InputStream;
 import java.io.InterruptedIOException;
-import java.net.URLEncoder;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 
@@ -53,9 +51,9 @@ import org.apache.http.NoHttpResponseExc
 import org.apache.http.HttpException;
 import org.apache.http.ParseException;
 
-import org.apache.commons.io.IOUtils;
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
 import org.apache.manifoldcf.agents.interfaces.ServiceInterruption;
+import org.apache.manifoldcf.core.util.URLEncoder;
 
 public class ElasticSearchConnection
 {
@@ -94,16 +92,6 @@ public class ElasticSearchConnection
     indexName = config.getIndexName();
   }
 
-  protected final String urlEncode(String t) throws ManifoldCFException
-  {
-    try
-    {
-      return URLEncoder.encode(t, "UTF-8");
-    } catch (UnsupportedEncodingException e)
-    {
-      throw new ManifoldCFException(e);
-    }
-  }
 
   protected StringBuffer getApiUrl(String command, boolean checkConnection) throws ManifoldCFException
   {
@@ -111,7 +99,7 @@ public class ElasticSearchConnection
     if (!serverLocation.endsWith("/"))
       url.append('/');
     if(!checkConnection)
-      url.append(urlEncode(indexName)+"/");
+      url.append(URLEncoder.encode(indexName)).append("/");
     url.append(command);
     callUrlSnippet = url.toString();
     return url;

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchDelete.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchDelete.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchDelete.java (original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchDelete.java Fri Apr 18 23:21:23 2014
@@ -24,7 +24,7 @@ import org.apache.http.client.methods.Ht
 
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
 import org.apache.manifoldcf.agents.interfaces.ServiceInterruption;
-import org.apache.manifoldcf.agents.output.elasticsearch.ElasticSearchConnection.Result;
+import org.apache.manifoldcf.core.util.URLEncoder;
 import org.apache.manifoldcf.crawler.system.Logging;
 
 public class ElasticSearchDelete extends ElasticSearchConnection
@@ -38,7 +38,7 @@ public class ElasticSearchDelete extends
   public void execute(String documentURI)
       throws ManifoldCFException, ServiceInterruption
   {
-      String idField = urlEncode(documentURI);
+      String idField = URLEncoder.encode(documentURI);
       HttpDelete method = new HttpDelete(config.getServerLocation() +
           "/" + config.getIndexName() + "/" + config.getIndexType()
           + "/" + idField);

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java (original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java Fri Apr 18 23:21:23 2014
@@ -40,6 +40,7 @@ import org.apache.manifoldcf.agents.inte
 import org.apache.manifoldcf.agents.output.elasticsearch.ElasticSearchConnection.Result;
 import org.apache.manifoldcf.core.common.Base64;
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
+import org.apache.manifoldcf.core.util.URLEncoder;
 import org.apache.manifoldcf.crawler.system.Logging;
 
 public class ElasticSearchIndex extends ElasticSearchConnection
@@ -269,7 +270,7 @@ public class ElasticSearchIndex extends 
   {
     String idField;
 
-    idField = urlEncode(documentURI);
+    idField = URLEncoder.encode(documentURI);
 
     StringBuffer url = getApiUrl(config.getIndexType() + "/" + idField, false);
     HttpPut put = new HttpPut(url.toString());

Modified: manifoldcf/trunk/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/email/EmailConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/email/EmailConnector.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/email/EmailConnector.java (original)
+++ manifoldcf/trunk/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/email/EmailConnector.java Fri Apr 18 23:21:23 2014
@@ -23,6 +23,7 @@ import org.apache.commons.lang.StringUti
 import org.apache.manifoldcf.agents.interfaces.RepositoryDocument;
 import org.apache.manifoldcf.agents.interfaces.ServiceInterruption;
 import org.apache.manifoldcf.core.interfaces.*;
+import org.apache.manifoldcf.core.util.URLEncoder;
 import org.apache.manifoldcf.crawler.interfaces.*;
 import org.apache.manifoldcf.crawler.system.Logging;
 
@@ -1120,18 +1121,14 @@ public class EmailConnector extends org.
   /** Create a document's URI given a template, a folder name, and a message ID */
   protected static String makeDocumentURI(String urlTemplate, String folderName, String id)
   {
-    try {
       // First, URL encode folder name and id
-      String encodedFolderName = java.net.URLEncoder.encode(folderName, "utf-8");
-      String encodedId = java.net.URLEncoder.encode(id, "utf-8");
+      String encodedFolderName = URLEncoder.encode(folderName);
+      String encodedId = URLEncoder.encode(id);
       // The template is already URL encoded, except for the substitution points
       Map<String,String> subsMap = new HashMap<String,String>();
       subsMap.put("FOLDERNAME", encodedFolderName);
       subsMap.put("MESSAGEID", encodedId);
       return substitute(urlTemplate, subsMap);
-    } catch (UnsupportedEncodingException e) {
-      throw new RuntimeException("No utf-8 encoder found: "+e.getMessage(), e);
-    }
   }
 
   protected static String substitute(String template, Map<String,String> map)

Modified: manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java (original)
+++ manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java Fri Apr 18 23:21:23 2014
@@ -25,10 +25,10 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InterruptedIOException;
 import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
+
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URLEncoder;
+
 import java.nio.channels.ClosedChannelException;
 import java.nio.channels.FileChannel;
 import java.nio.channels.FileLock;

Modified: manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java (original)
+++ manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java Fri Apr 18 23:21:23 2014
@@ -27,8 +27,6 @@ import java.util.*;
 import java.io.*;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URLDecoder;
-import java.net.URLEncoder;
 
 /** This is the "repository connector" for a file system.  It's a relative of the share crawler, and should have
 * comparable basic functionality, with the exception of the ability to use ActiveDirectory and look at other shares.

Modified: manifoldcf/trunk/connectors/generic/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/generic/GenericAuthority.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/generic/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/generic/GenericAuthority.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/generic/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/generic/GenericAuthority.java (original)
+++ manifoldcf/trunk/connectors/generic/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/generic/GenericAuthority.java Fri Apr 18 23:21:23 2014
@@ -16,10 +16,11 @@
 package org.apache.manifoldcf.authorities.authorities.generic;
 
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.net.URLEncoder;
+import org.apache.manifoldcf.core.util.URLEncoder;
+
+import java.nio.charset.StandardCharsets;
 import java.util.List;
 import java.util.Locale;
 import javax.xml.bind.JAXBContext;
@@ -284,12 +285,9 @@ public class GenericAuthority extends or
   protected AuthorizationResponse getAuthorizationResponseUncached(HttpClient client, String userName)
     throws ManifoldCFException {
     StringBuilder url = new StringBuilder(genericEntryPoint);
-    try {
-      url.append("?").append(ACTION_PARAM_NAME).append("=").append(ACTION_AUTH);
-      url.append("&username=").append(URLEncoder.encode(userName, "UTF-8"));
-    } catch (UnsupportedEncodingException ex) {
-      throw new ManifoldCFException("getAuthorizationResponseUncached error: " + ex.getMessage(), ex);
-    }
+    url.append("?").append(ACTION_PARAM_NAME).append("=").append(ACTION_AUTH);
+    url.append("&username=").append(URLEncoder.encode(userName));
+
 
     try {
       FetchTokensThread t = new FetchTokensThread(client, url.toString());

Modified: manifoldcf/trunk/connectors/generic/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/generic/GenericConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/generic/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/generic/GenericConnector.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/generic/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/generic/GenericConnector.java (original)
+++ manifoldcf/trunk/connectors/generic/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/generic/GenericConnector.java Fri Apr 18 23:21:23 2014
@@ -20,7 +20,7 @@ package org.apache.manifoldcf.crawler.co
 import java.io.*;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.net.URLEncoder;
+import org.apache.manifoldcf.core.util.URLEncoder;
 import java.nio.charset.StandardCharsets;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -205,13 +205,9 @@ public class GenericConnector extends Ba
     for (int i = 0; i < spec.getChildCount(); i++) {
       SpecificationNode sn = spec.getChild(i);
       if (sn.getType().equals("param")) {
-        try {
           String paramName = sn.getAttributeValue("name");
           String paramValue = sn.getValue();
-          url.append("&").append(URLEncoder.encode(paramName, "UTF-8")).append("=").append(URLEncoder.encode(paramValue, "UTF-8"));
-        } catch (UnsupportedEncodingException ex) {
-          throw new ManifoldCFException("addSeedDocuments error: " + ex.getMessage(), ex);
-        }
+          url.append("&").append(URLEncoder.encode(paramName)).append("=").append(URLEncoder.encode(paramValue));
       }
     }
     ExecuteSeedingThread t = new ExecuteSeedingThread(client, url.toString());
@@ -273,22 +269,19 @@ public class GenericConnector extends Ba
 
     HttpClient client = getClient();
     StringBuilder url = new StringBuilder(genericEntryPoint);
-    try {
+
       url.append("?").append(ACTION_PARAM_NAME).append("=").append(ACTION_ITEMS);
       for (int i = 0; i < documentIdentifiers.length; i++) {
-        url.append("&id[]=").append(URLEncoder.encode(documentIdentifiers[i], "UTF-8"));
+        url.append("&id[]=").append(URLEncoder.encode(documentIdentifiers[i]));
       }
       for (int i = 0; i < spec.getChildCount(); i++) {
         SpecificationNode sn = spec.getChild(i);
         if (sn.getType().equals("param")) {
           String paramName = sn.getAttributeValue("name");
           String paramValue = sn.getValue();
-          url.append("&").append(URLEncoder.encode(paramName, "UTF-8")).append("=").append(URLEncoder.encode(paramValue, "UTF-8"));
+          url.append("&").append(URLEncoder.encode(paramName)).append("=").append(URLEncoder.encode(paramValue));
         }
       }
-    } catch (UnsupportedEncodingException ex) {
-      throw new ManifoldCFException("getDocumentVersions error: " + ex.getMessage(), ex);
-    }
     try {
       DocumentVersionThread versioningThread = new DocumentVersionThread(client, url.toString(), documentIdentifiers, genericAuthMode, rights, documentCache);
       versioningThread.start();
@@ -416,20 +409,18 @@ public class GenericConnector extends Ba
         }
       } else {
         StringBuilder url = new StringBuilder(genericEntryPoint);
-        try {
+
           url.append("?").append(ACTION_PARAM_NAME).append("=").append(ACTION_ITEM);
-          url.append("&id=").append(URLEncoder.encode(documentIdentifiers[i], "UTF-8"));
+          url.append("&id=").append(URLEncoder.encode(documentIdentifiers[i]));
           for (int j = 0; j < spec.getChildCount(); j++) {
             SpecificationNode sn = spec.getChild(j);
             if (sn.getType().equals("param")) {
               String paramName = sn.getAttributeValue("name");
               String paramValue = sn.getValue();
-              url.append("&").append(URLEncoder.encode(paramName, "UTF-8")).append("=").append(URLEncoder.encode(paramValue, "UTF-8"));
+              url.append("&").append(URLEncoder.encode(paramName)).append("=").append(URLEncoder.encode(paramValue));
             }
           }
-        } catch (UnsupportedEncodingException ex) {
-          throw new ManifoldCFException("processDocuments error: " + ex.getMessage(), ex);
-        }
+
 
         ExecuteProcessThread t = new ExecuteProcessThread(client, url.toString());
         try {

Modified: manifoldcf/trunk/connectors/gts/connector/src/main/java/org/apache/manifoldcf/agents/output/gts/HttpPoster.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/gts/connector/src/main/java/org/apache/manifoldcf/agents/output/gts/HttpPoster.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/gts/connector/src/main/java/org/apache/manifoldcf/agents/output/gts/HttpPoster.java (original)
+++ manifoldcf/trunk/connectors/gts/connector/src/main/java/org/apache/manifoldcf/agents/output/gts/HttpPoster.java Fri Apr 18 23:21:23 2014
@@ -1011,10 +1011,6 @@ public class HttpPoster
             }
           }
         }
-        catch (UnsupportedEncodingException ioe)
-        {
-          throw new ManifoldCFException("Fatal ingestion error: "+ioe.getMessage(),ioe);
-        }
         catch (java.net.SocketTimeoutException ioe)
         {
           // These are just like IO errors, but since they are derived from InterruptedIOException, they have to be caught first.
@@ -1240,10 +1236,6 @@ public class HttpPoster
             }
           }
         }
-        catch (UnsupportedEncodingException ioe)
-        {
-          throw new ManifoldCFException("Fatal ingestion error: "+ioe.getMessage(),ioe);
-        }
         catch (InterruptedIOException ioe)
         {
           return;
@@ -1392,10 +1384,6 @@ public class HttpPoster
             }
           }
         }
-        catch (UnsupportedEncodingException ioe)
-        {
-          throw new ManifoldCFException("Fatal ingestion error: "+ioe.getMessage(),ioe);
-        }
         catch (InterruptedIOException ioe)
         {
           // Exit the thread.

Modified: manifoldcf/trunk/connectors/hdfs/connector/src/main/java/org/apache/manifoldcf/agents/output/hdfs/HDFSOutputConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/hdfs/connector/src/main/java/org/apache/manifoldcf/agents/output/hdfs/HDFSOutputConnector.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/hdfs/connector/src/main/java/org/apache/manifoldcf/agents/output/hdfs/HDFSOutputConnector.java (original)
+++ manifoldcf/trunk/connectors/hdfs/connector/src/main/java/org/apache/manifoldcf/agents/output/hdfs/HDFSOutputConnector.java Fri Apr 18 23:21:23 2014
@@ -25,10 +25,8 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InterruptedIOException;
 import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URLEncoder;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;

Modified: manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java (original)
+++ manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java Fri Apr 18 23:21:23 2014
@@ -16,6 +16,7 @@
 */
 package org.apache.manifoldcf.crawler.connectors.sharedrive;
 
+import org.apache.manifoldcf.core.util.URLEncoder;
 import org.apache.manifoldcf.crawler.system.ManifoldCF;
 import java.io.FileOutputStream;
 import java.io.FileInputStream;
@@ -334,8 +335,7 @@ public class SharedDriveConnector extend
       // Second, the ingestion API does not (and will never) accept anything other than a well-formed URI.  Thus, file
       // specifications are ingested in a canonical form (which happens to be pretty much what this connector used prior to
       // 3.9.0), and the various clients are responsible for converting that form into something the browser will accept.
-      try
-      {
+
         StringBuilder output = new StringBuilder();
 
         int i = 0;
@@ -346,7 +346,7 @@ public class SharedDriveConnector extend
             pos = serverPath.length();
           String piece = serverPath.substring(i,pos);
           // Note well.  This does *not* %-encode some characters such as '#', which are legal in URI's but have special meanings!
-          String replacePiece = java.net.URLEncoder.encode(piece,"utf-8");
+          String replacePiece = URLEncoder.encode(piece);
           // Convert the +'s back to %20's
           int j = 0;
           while (j < replacePiece.length())
@@ -371,12 +371,6 @@ public class SharedDriveConnector extend
           i = pos;
         }
         return "file://///"+output.toString();
-      }
-      catch (java.io.UnsupportedEncodingException e)
-      {
-        // Should not happen...
-        throw new ManifoldCFException(e.getMessage(),e);
-      }
     }
   }
 

Modified: manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jira/JiraSession.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jira/JiraSession.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jira/JiraSession.java (original)
+++ manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jira/JiraSession.java Fri Apr 18 23:21:23 2014
@@ -20,6 +20,7 @@ package org.apache.manifoldcf.authoritie
 import org.apache.manifoldcf.core.common.*;
 import org.apache.manifoldcf.core.interfaces.KeystoreManagerFactory;
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
+import org.apache.manifoldcf.core.util.URLEncoder;
 
 import java.io.Reader;
 import java.io.Writer;
@@ -31,7 +32,6 @@ import java.io.InputStreamReader;
 import java.io.InterruptedIOException;
 import java.io.OutputStream;
 import java.net.URL;
-import java.net.URLEncoder;
 import java.nio.charset.Charset;
 
 import java.nio.charset.StandardCharsets;
@@ -291,9 +291,9 @@ public class JiraSession {
 
   /** Check if user exists.
   */
-  public boolean checkUserExists(String userName) throws IOException, ResponseException {
+  public boolean checkUserExists(String userName) throws IOException, ResponseException, ManifoldCFException {
     JiraUserQueryResults qr = new JiraUserQueryResults();
-    getRest("user/search?username="+URLEncoder.encode(userName,"utf-8")+"&maxResults=1&startAt=0", qr);
+    getRest("user/search?username="+URLEncoder.encode(userName)+"&maxResults=1&startAt=0", qr);
     List<String> values = new ArrayList<String>();
     qr.getNames(values);
     if (values.size() == 0)

Modified: manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraSession.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraSession.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraSession.java (original)
+++ manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraSession.java Fri Apr 18 23:21:23 2014
@@ -28,10 +28,8 @@ import java.io.StringWriter;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.io.InterruptedIOException;
-import java.io.OutputStream;
-import java.net.URL;
-import java.net.URLEncoder;
+
+import org.apache.manifoldcf.core.util.URLEncoder;
 import java.nio.charset.Charset;
 
 import java.nio.charset.StandardCharsets;
@@ -295,13 +293,13 @@ public class JiraSession {
    * Get the list of matching root documents, e.g. seeds.
    */
   public void getSeeds(XThreadStringBuffer idBuffer, String jiraDriveQuery)
-      throws IOException, ResponseException, InterruptedException {
+      throws IOException, ResponseException, InterruptedException, ManifoldCFException {
     long startAt = 0L;
     long setSize = 800L;
     long totalAmt = 0L;
     do {
       JiraQueryResults qr = new JiraQueryResults();
-      getRest("search?maxResults=" + setSize + "&startAt=" + startAt + "&jql=" + URLEncoder.encode(jiraDriveQuery, "UTF-8"), qr);
+      getRest("search?maxResults=" + setSize + "&startAt=" + startAt + "&jql=" + URLEncoder.encode(jiraDriveQuery), qr);
       Long total = qr.getTotal();
       if (total == null)
         return;
@@ -315,13 +313,13 @@ public class JiraSession {
   * Get the list of users that can see the specified issue.
   */
   public List<String> getUsers(String issueKey)
-    throws IOException, ResponseException {
+    throws IOException, ResponseException, ManifoldCFException {
     List<String> rval = new ArrayList<String>();
     long startAt = 0L;
     long setSize = 800L;
     while (true) {
       JiraUserQueryResults qr = new JiraUserQueryResults();
-      getRest("user/viewissue/search?username=&issueKey="+URLEncoder.encode(issueKey,"utf-8")+"&maxResults=" + setSize + "&startAt=" + startAt, qr);
+      getRest("user/viewissue/search?username=&issueKey="+URLEncoder.encode(issueKey)+"&maxResults=" + setSize + "&startAt=" + startAt, qr);
       qr.getNames(rval);
       startAt += setSize;
       if (rval.size() < startAt)
@@ -334,9 +332,9 @@ public class JiraSession {
    * Get an individual issue.
    */
   public JiraIssue getIssue(String issueKey)
-    throws IOException, ResponseException {
+    throws IOException, ResponseException, ManifoldCFException {
     JiraIssue ji = new JiraIssue();
-    getRest("issue/" + URLEncoder.encode(issueKey,"utf-8"), ji);
+    getRest("issue/" + URLEncoder.encode(issueKey), ji);
     return ji;
   }
 

Modified: manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java (original)
+++ manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java Fri Apr 18 23:21:23 2014
@@ -4190,24 +4190,17 @@ public class LivelinkConnector extends o
   protected String createLivelinkLoginURI()
     throws ManifoldCFException
   {
-    try
-    {
       StringBuilder llURI = new StringBuilder();
 
       llURI.append(ingestCgiPath);
       llURI.append("?func=ll.login&CurrentClientTime=D%2F2005%2F3%2F9%3A13%3A16%3A30&NextURL=");
-      llURI.append(URLEncoder.encode(ingestCgiPath,"UTF-8"));
+      llURI.append(org.apache.manifoldcf.core.util.URLEncoder.encode(ingestCgiPath));
       llURI.append("%3FRedirect%3D1&Username=");
-      llURI.append(URLEncoder.encode(llServer.getLLUser(),"UTF-8"));
+      llURI.append(org.apache.manifoldcf.core.util.URLEncoder.encode(llServer.getLLUser()));
       llURI.append("&Password=");
-      llURI.append(URLEncoder.encode(llServer.getLLPwd(),"UTF-8"));
+      llURI.append(org.apache.manifoldcf.core.util.URLEncoder.encode(llServer.getLLPwd()));
 
       return llURI.toString();
-    }
-    catch (UnsupportedEncodingException e)
-    {
-      throw new ManifoldCFException("Login URI setup error: "+e.getMessage(),e);
-    }
   }
 
   /**

Modified: manifoldcf/trunk/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnection.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnection.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnection.java (original)
+++ manifoldcf/trunk/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnection.java Fri Apr 18 23:21:23 2014
@@ -19,14 +19,12 @@ package org.apache.manifoldcf.agents.out
 
 import java.io.IOException;
 import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
 import java.io.Writer;
 import java.io.StringWriter;
 import java.io.Reader;
 import java.io.InputStreamReader;
 import java.io.InputStream;
 import java.io.InterruptedIOException;
-import java.net.URLEncoder;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 
@@ -53,6 +51,7 @@ import org.apache.http.HttpException;
 import org.apache.http.ParseException;
 
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
+import org.apache.manifoldcf.core.util.URLEncoder;
 import org.w3c.dom.Document;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
@@ -99,26 +98,18 @@ public class OpenSearchServerConnection 
     apiKey = config.getApiKey();
   }
 
-  protected final String urlEncode(String t) throws ManifoldCFException {
-    try {
-      return URLEncoder.encode(t, "UTF-8");
-    } catch (UnsupportedEncodingException e) {
-      throw new ManifoldCFException(e);
-    }
-  }
-
   protected StringBuffer getApiUrl(String command) throws ManifoldCFException {
     StringBuffer url = new StringBuffer(serverLocation);
     if (!serverLocation.endsWith("/"))
       url.append('/');
     url.append(command);
     url.append("?use=");
-    url.append(urlEncode(indexName));
+    url.append(URLEncoder.encode(indexName));
     callUrlSnippet = url.toString();
     if (userName != null && apiKey != null && userName.length() > 0
         && apiKey.length() > 0) {
       url.append("&login=");
-      url.append(urlEncode(userName));
+      url.append(URLEncoder.encode(userName));
       url.append("&key=");
       url.append(apiKey);
     }

Modified: manifoldcf/trunk/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnector.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnector.java (original)
+++ manifoldcf/trunk/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnector.java Fri Apr 18 23:21:23 2014
@@ -17,12 +17,12 @@
 
 package org.apache.manifoldcf.agents.output.opensearchserver;
 
-import java.io.BufferedReader;
+
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
+
+
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
@@ -42,7 +42,6 @@ import org.apache.http.client.HttpReques
 import org.apache.http.protocol.HttpContext;
 
 import org.apache.commons.io.FilenameUtils;
-import org.apache.commons.io.IOUtils;
 import org.apache.manifoldcf.agents.interfaces.IOutputAddActivity;
 import org.apache.manifoldcf.agents.interfaces.IOutputNotifyActivity;
 import org.apache.manifoldcf.agents.interfaces.IOutputRemoveActivity;

Modified: manifoldcf/trunk/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerDelete.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerDelete.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerDelete.java (original)
+++ manifoldcf/trunk/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerDelete.java Fri Apr 18 23:21:23 2014
@@ -21,6 +21,7 @@ import org.apache.http.client.HttpClient
 import org.apache.http.client.methods.HttpGet;
 
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
+import org.apache.manifoldcf.core.util.URLEncoder;
 
 public class OpenSearchServerDelete extends OpenSearchServerConnection {
 
@@ -29,7 +30,7 @@ public class OpenSearchServerDelete exte
     super(client, config);
     StringBuffer url = getApiUrl("delete");
     url.append("&uniq=");
-    url.append(urlEncode(documentURI));
+    url.append(URLEncoder.encode(documentURI));
     HttpGet method = new HttpGet(url.toString());
     call(method);
     if ("OK".equals(checkXPath(xPathStatus)))

Modified: manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/RSSConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/RSSConnector.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/RSSConnector.java (original)
+++ manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/RSSConnector.java Fri Apr 18 23:21:23 2014
@@ -877,10 +877,6 @@ public class RSSConnector extends org.ap
                 is.close();
               }
             }
-            catch (UnsupportedEncodingException e)
-            {
-              throw new ManifoldCFException("Unsupported encoding: "+e.getMessage(),e);
-            }
             catch (java.net.SocketTimeoutException e)
             {
               throw new ManifoldCFException("IO exception reading data from string: "+e.getMessage(),e);

Modified: manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/sharepoint/SharePointADAuthority.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/sharepoint/SharePointADAuthority.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/sharepoint/SharePointADAuthority.java (original)
+++ manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/sharepoint/SharePointADAuthority.java Fri Apr 18 23:21:23 2014
@@ -23,6 +23,7 @@ import org.apache.manifoldcf.agents.inte
 import org.apache.manifoldcf.authorities.interfaces.*;
 import org.apache.manifoldcf.authorities.system.Logging;
 import org.apache.manifoldcf.authorities.system.ManifoldCF;
+import org.apache.manifoldcf.core.util.URLEncoder;
 
 import java.io.*;
 import java.util.*;
@@ -471,14 +472,7 @@ public class SharePointADAuthority exten
   
   protected static String userTokenFromLoginName(String loginName)
   {
-    try
-    {
-      return "Ui:0#.w|"+URLEncoder.encode(loginName,"utf-8").toLowerCase(Locale.ROOT);
-    }
-    catch (UnsupportedEncodingException e)
-    {
-      throw new RuntimeException("Utf-8 encoding unrecognized");
-    }
+      return "Ui:0#.w|"+URLEncoder.encode(loginName).toLowerCase(Locale.ROOT);
   }
   
   // UI support methods.
@@ -519,8 +513,8 @@ public class SharePointADAuthority exten
     Map<String,Object> velocityContext = new HashMap<String,Object>();
     velocityContext.put("TabName",tabName);
     fillInDomainControllerTab(velocityContext,out,parameters);
-    fillInCacheTab(velocityContext,out,parameters);
-    Messages.outputResourceWithVelocity(out,locale,"editADConfiguration_DomainController.html",velocityContext);
+    fillInCacheTab(velocityContext, out, parameters);
+    Messages.outputResourceWithVelocity(out, locale, "editADConfiguration_DomainController.html", velocityContext);
     Messages.outputResourceWithVelocity(out,locale,"editADConfiguration_Cache.html",velocityContext);
   }
 
@@ -544,7 +538,7 @@ public class SharePointADAuthority exten
         domainControllers.add(createDomainControllerMap(mapper,dcSuffix,dcDomainController,dcUserName,dcPassword,dcAuthentication,dcUserACLsUsername));
       }
     }
-    velocityContext.put("DOMAINCONTROLLERS",domainControllers);
+    velocityContext.put("DOMAINCONTROLLERS", domainControllers);
   }
 
   protected static Map<String,String> createDomainControllerMap(IPasswordMapperActivity mapper, String suffix, String domainControllerName,

Modified: manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/sharepoint/SharePointAuthority.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/sharepoint/SharePointAuthority.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/sharepoint/SharePointAuthority.java (original)
+++ manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/sharepoint/SharePointAuthority.java Fri Apr 18 23:21:23 2014
@@ -23,6 +23,8 @@ import org.apache.manifoldcf.agents.inte
 import org.apache.manifoldcf.authorities.interfaces.*;
 import org.apache.manifoldcf.authorities.system.Logging;
 import org.apache.manifoldcf.authorities.system.ManifoldCF;
+import org.apache.manifoldcf.core.util.URLEncoder;
+import org.apache.manifoldcf.core.util.URLDecoder;
 
 import java.io.*;
 import java.util.*;
@@ -777,31 +779,16 @@ public class SharePointAuthority extends
   */
   public static String pathItemDecode(String pathItem)
   {
-    try
-    {
-      return java.net.URLDecoder.decode(pathItem.replaceAll("\\%20","+"),"utf-8");
-    }
-    catch (UnsupportedEncodingException e)
-    {
-      // Bad news, utf-8 not available!
-      throw new RuntimeException("No utf-8 encoding available");
-    }
+      return URLDecoder.decode(pathItem.replaceAll("\\%20","+"));
   }
 
   /** Encode a path item.
   */
   public static String pathItemEncode(String pathItem)
   {
-    try
-    {
-      String output = java.net.URLEncoder.encode(pathItem,"utf-8");
+      String output = URLEncoder.encode(pathItem);
       return output.replaceAll("\\+","%20");
-    }
-    catch (UnsupportedEncodingException e)
-    {
-      // Bad news, utf-8 not available!
-      throw new RuntimeException("No utf-8 encoding available");
-    }
+
   }
 
   /** Given a path that is /-separated, and otherwise encoded, decode properly to convert to

Modified: manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java (original)
+++ manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java Fri Apr 18 23:21:23 2014
@@ -25,6 +25,8 @@ import org.apache.manifoldcf.crawler.sys
 import org.apache.manifoldcf.crawler.system.ManifoldCF;
 import org.apache.manifoldcf.core.common.*;
 import org.apache.manifoldcf.core.extmimemap.ExtensionMimeMap;
+import org.apache.manifoldcf.core.util.URLEncoder;
+import org.apache.manifoldcf.core.util.URLDecoder;
 
 import java.io.*;
 import java.util.Date;
@@ -4469,31 +4471,16 @@ public class SharePointRepository extend
   */
   public static String pathItemDecode(String pathItem)
   {
-    try
-    {
-      return java.net.URLDecoder.decode(pathItem.replaceAll("\\%20","+"),"utf-8");
-    }
-    catch (UnsupportedEncodingException e)
-    {
-      // Bad news, utf-8 not available!
-      throw new RuntimeException("No utf-8 encoding available");
-    }
+      return URLDecoder.decode(pathItem.replaceAll("\\%20","+"));
+
   }
 
   /** Encode a path item.
   */
   public static String pathItemEncode(String pathItem)
   {
-    try
-    {
-      String output = java.net.URLEncoder.encode(pathItem,"utf-8");
+      String output = URLEncoder.encode(pathItem);
       return output.replaceAll("\\+","%20");
-    }
-    catch (UnsupportedEncodingException e)
-    {
-      // Bad news, utf-8 not available!
-      throw new RuntimeException("No utf-8 encoding available");
-    }
   }
 
   /** Given a path that is /-separated, and otherwise encoded, decode properly to convert to

Modified: manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java (original)
+++ manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java Fri Apr 18 23:21:23 2014
@@ -32,7 +32,7 @@ import org.apache.manifoldcf.agents.inte
 import org.apache.manifoldcf.agents.system.*;
 
 import java.io.*;
-import java.net.*;
+import java.net.MalformedURLException;
 import java.util.*;
 import java.util.regex.*;
 
@@ -40,6 +40,7 @@ import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.Credentials;
 import org.apache.http.auth.UsernamePasswordCredentials;
 
+import org.apache.manifoldcf.core.util.URLEncoder;
 import org.apache.solr.client.solrj.SolrServer;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.impl.CloudSolrServer;
@@ -761,14 +762,7 @@ public class HttpPoster
   */
   protected static String preEncode(String fieldName)
   {
-    try
-    {
-      return java.net.URLEncoder.encode(fieldName, "utf-8");
-    }
-    catch (IOException e)
-    {
-      throw new RuntimeException("Could not find utf-8 encoding!");
-    }
+      return URLEncoder.encode(fieldName);
   }
   
   /** Write a field */

Modified: manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/ModifiedHttpSolrServer.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/ModifiedHttpSolrServer.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/ModifiedHttpSolrServer.java (original)
+++ manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/ModifiedHttpSolrServer.java Fri Apr 18 23:21:23 2014
@@ -49,6 +49,7 @@ import org.apache.http.message.BasicHead
 import org.apache.http.message.BasicNameValuePair;
 import org.apache.http.util.EntityUtils;
 import org.apache.http.entity.ContentType;
+import org.apache.manifoldcf.core.util.URLDecoder;
 import org.apache.solr.client.solrj.impl.HttpSolrServer;
 import org.apache.solr.client.solrj.ResponseParser;
 import org.apache.solr.client.solrj.SolrRequest;
@@ -327,7 +328,7 @@ public class ModifiedHttpSolrServer exte
           msg.append(response.getStatusLine().getReasonPhrase());
           msg.append("\n\n");
           msg.append("request: " + method.getURI());
-          reason = java.net.URLDecoder.decode(msg.toString(), StandardCharsets.UTF_8.name());
+          reason = URLDecoder.decode(msg.toString());
         }
         throw new SolrException(
             SolrException.ErrorCode.getErrorCode(httpStatus), reason);

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=1588591&r1=1588590&r2=1588591&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 Fri Apr 18 23:21:23 2014
@@ -23,6 +23,7 @@ import org.apache.manifoldcf.core.common
 import org.apache.manifoldcf.core.common.XThreadInputStream;
 import org.apache.manifoldcf.core.common.InterruptibleSocketFactory;
 import org.apache.manifoldcf.agents.interfaces.*;
+import org.apache.manifoldcf.core.util.URLEncoder;
 import org.apache.manifoldcf.crawler.interfaces.*;
 import org.apache.manifoldcf.crawler.system.Logging;
 import org.apache.manifoldcf.crawler.system.ManifoldCF;
@@ -30,10 +31,8 @@ import org.apache.manifoldcf.crawler.sys
 import java.nio.charset.StandardCharsets;
 import java.util.*;
 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.HttpClientConnectionManager;
 import org.apache.http.client.HttpClient;
@@ -593,8 +592,7 @@ public class ThrottledFetcher
             appendChar = '?';
           else
             appendChar = '&';
-          try
-          {
+
             while (iter.hasNext())
             {
               FormDataElement el = (FormDataElement)iter.next();
@@ -602,17 +600,13 @@ public class ThrottledFetcher
               appendChar = '&';
               String param = el.getElementName();
               String value = el.getElementValue();
-              psb.append(java.net.URLEncoder.encode(param,"utf-8"));
+              psb.append(URLEncoder.encode(param));
               if (value != null)
               {
-                psb.append('=').append(java.net.URLEncoder.encode(value,"utf-8"));
+                psb.append('=').append(URLEncoder.encode(value));
               }
             }
-          }
-          catch (java.io.UnsupportedEncodingException e)
-          {
-            throw new ManifoldCFException("Unsupported encoding: "+e.getMessage(),e);
-          }
+
 
           fullUrlPath = psb.toString();
         }

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=1588591&r1=1588590&r2=1588591&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 Fri Apr 18 23:21:23 2014
@@ -24,6 +24,8 @@ import org.apache.manifoldcf.crawler.int
 import org.apache.manifoldcf.crawler.system.Logging;
 
 import org.apache.manifoldcf.core.common.*;
+import org.apache.manifoldcf.core.util.URLEncoder;
+
 
 import org.xml.sax.Attributes;
 
@@ -73,12 +75,10 @@ import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 import java.util.*;
 import java.io.*;
-import java.net.*;
+
 
 import java.util.concurrent.TimeUnit;
 
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 /** This is the repository connector for a wiki.
 */
@@ -2464,18 +2464,11 @@ public class WikiConnector extends org.a
   protected String getListPagesURL(String startingTitle, String namespace, String prefix)
     throws ManifoldCFException
   {
-    try
-    {
       return baseURL + "action=query&list=allpages" +
-        ((prefix != null)?"&apprefix="+URLEncoder.encode(prefix,"utf-8"):"") +
-        ((namespace != null)?"&apnamespace="+URLEncoder.encode(namespace,"utf-8"):"") +
-        ((startingTitle!=null)?"&apfrom="+URLEncoder.encode(startingTitle,"utf-8"):"") +
+        ((prefix != null)?"&apprefix="+URLEncoder.encode(prefix):"") +
+        ((namespace != null)?"&apnamespace="+URLEncoder.encode(namespace):"") +
+        ((startingTitle!=null)?"&apfrom="+URLEncoder.encode(startingTitle):"") +
         "&aplimit=500";
-    }
-    catch (UnsupportedEncodingException e)
-    {
-      throw new ManifoldCFException(e.getMessage(),e);
-    }
   }
 
   protected static class ReturnString
@@ -2864,14 +2857,7 @@ public class WikiConnector extends org.a
         sb.append("|");
       sb.append(documentIdentifiers[i]);
     }
-    try
-    {
-      return baseURL + "action=query&prop=info&pageids="+URLEncoder.encode(sb.toString(),"utf-8")+"&inprop=url";
-    }
-    catch (UnsupportedEncodingException e)
-    {
-      throw new ManifoldCFException(e.getMessage(),e);
-    }
+      return baseURL + "action=query&prop=info&pageids="+URLEncoder.encode(sb.toString())+"&inprop=url";
   }
 
   /** Thread to execute a "get timestamp" operation.  This thread both executes the operation and parses the result. */
@@ -3188,14 +3174,7 @@ public class WikiConnector extends org.a
         sb.append("|");
       sb.append(documentIdentifiers[i]);
     }
-    try
-    {
-      return baseURL + "action=query&prop=revisions&pageids="+URLEncoder.encode(sb.toString(),"utf-8")+"&rvprop=timestamp";
-    }
-    catch (UnsupportedEncodingException e)
-    {
-      throw new ManifoldCFException(e.getMessage(),e);
-    }
+      return baseURL + "action=query&prop=revisions&pageids="+URLEncoder.encode(sb.toString())+"&rvprop=timestamp";
   }
 
   /** Thread to execute a "get timestamp" operation.  This thread both executes the operation and parses the result. */

Modified: manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/common/XMLFileContext.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/common/XMLFileContext.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/common/XMLFileContext.java (original)
+++ manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/common/XMLFileContext.java Fri Apr 18 23:21:23 2014
@@ -27,7 +27,6 @@ import org.xml.sax.SAXException;
 
 import java.io.File;
 import java.io.FileOutputStream;
-import java.io.UnsupportedEncodingException;
 import java.io.FileNotFoundException;
 
 import org.apache.manifoldcf.core.interfaces.*;
@@ -41,7 +40,7 @@ public class XMLFileContext extends XMLO
 
   /** Full constructor.  Used for individual tags. */
   public XMLFileContext(XMLStream theStream, String namespaceURI, String localname, String qname, Attributes theseAttributes, File f)
-    throws ManifoldCFException, UnsupportedEncodingException, FileNotFoundException
+    throws FileNotFoundException
   {
     // Construct an appropriate writer
     super(theStream,namespaceURI,localname,qname,theseAttributes,new FileOutputStream(f));

Modified: manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/common/XMLOutputStreamContext.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/common/XMLOutputStreamContext.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/common/XMLOutputStreamContext.java (original)
+++ manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/common/XMLOutputStreamContext.java Fri Apr 18 23:21:23 2014
@@ -27,7 +27,6 @@ import org.xml.sax.SAXException;
 
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
 import java.io.IOException;
 import java.io.InterruptedIOException;
 import java.nio.charset.StandardCharsets;
@@ -43,7 +42,6 @@ public class XMLOutputStreamContext exte
 
   /** Full constructor.  Used for individual tags. */
   public XMLOutputStreamContext(XMLStream theStream, String namespaceURI, String localname, String qname, Attributes theseAttributes, OutputStream os)
-    throws ManifoldCFException, UnsupportedEncodingException
   {
     // Construct an appropriate writer
     super(theStream,namespaceURI,localname,qname,theseAttributes,new OutputStreamWriter(os, StandardCharsets.UTF_8));

Modified: manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/common/XMLWriterContext.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/common/XMLWriterContext.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/common/XMLWriterContext.java (original)
+++ manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/common/XMLWriterContext.java Fri Apr 18 23:21:23 2014
@@ -41,7 +41,6 @@ public class XMLWriterContext extends XM
 
   /** Full constructor.  Used for individual tags. */
   public XMLWriterContext(XMLStream theStream, String namespaceURI, String localname, String qname, Attributes theseAttributes, Writer writer)
-    throws ManifoldCFException
   {
     super(theStream,namespaceURI,localname,qname,theseAttributes);
     theWriter = writer;

Modified: manifoldcf/trunk/framework/api-servlet/src/main/java/org/apache/manifoldcf/apiservlet/APIServlet.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/api-servlet/src/main/java/org/apache/manifoldcf/apiservlet/APIServlet.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/framework/api-servlet/src/main/java/org/apache/manifoldcf/apiservlet/APIServlet.java (original)
+++ manifoldcf/trunk/framework/api-servlet/src/main/java/org/apache/manifoldcf/apiservlet/APIServlet.java Fri Apr 18 23:21:23 2014
@@ -23,11 +23,11 @@ import org.apache.manifoldcf.agents.inte
 import org.apache.manifoldcf.crawler.interfaces.*;
 import org.apache.manifoldcf.crawler.system.ManifoldCF;
 import org.apache.manifoldcf.crawler.system.Logging;
-
+import org.apache.manifoldcf.core.util.URLDecoder;
 import java.io.*;
 import java.nio.charset.StandardCharsets;
 import java.util.*;
-import java.net.*;
+
 
 import javax.servlet.*;
 import javax.servlet.http.*;
@@ -581,7 +581,6 @@ public class APIServlet extends HttpServ
   }
   
   protected static Map<String,List<String>> parseQueryString(String queryString)
-    throws UnsupportedEncodingException
   {
     if (queryString == null)
       return null;
@@ -591,9 +590,9 @@ public class APIServlet extends HttpServ
     {
       int index = term.indexOf("=");
       if (index == -1)
-        addValue(rval,URLDecoder.decode(term,"utf-8"),"");
+        addValue(rval,URLDecoder.decode(term),"");
       else
-        addValue(rval,URLDecoder.decode(term.substring(0,index),"utf-8"),URLDecoder.decode(term.substring(index+1),"utf-8"));
+        addValue(rval,URLDecoder.decode(term.substring(0,index)),URLDecoder.decode(term.substring(index+1)));
     }
     return rval;
   }

Modified: manifoldcf/trunk/framework/authority-servlet/src/main/java/org/apache/manifoldcf/authorityservlet/UserACLServlet.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/authority-servlet/src/main/java/org/apache/manifoldcf/authorityservlet/UserACLServlet.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/framework/authority-servlet/src/main/java/org/apache/manifoldcf/authorityservlet/UserACLServlet.java (original)
+++ manifoldcf/trunk/framework/authority-servlet/src/main/java/org/apache/manifoldcf/authorityservlet/UserACLServlet.java Fri Apr 18 23:21:23 2014
@@ -25,10 +25,12 @@ import org.apache.manifoldcf.authorities
 import org.apache.manifoldcf.authorities.system.RequestQueue;
 import org.apache.manifoldcf.authorities.system.AuthRequest;
 import org.apache.manifoldcf.authorities.system.MappingRequest;
+import org.apache.manifoldcf.core.util.URLEncoder;
 
 import java.io.*;
+import java.nio.charset.StandardCharsets;
 import java.util.*;
-import java.net.*;
+
 
 import javax.servlet.*;
 import javax.servlet.http.*;
@@ -370,27 +372,27 @@ public class UserACLServlet extends Http
           {
             if (Logging.authorityService.isDebugEnabled())
               Logging.authorityService.debug("User '"+ar.getUserID()+"' mapping failed for authority '"+ar.getIdentifyingString()+"'");
-            sb.append(USERNOTFOUND_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");
+            sb.append(USERNOTFOUND_VALUE).append(URLEncoder.encode(ar.getIdentifyingString())).append("\n");
           }
           else if (reply.getResponseStatus() == AuthorizationResponse.RESPONSE_UNREACHABLE)
           {
             Logging.authorityService.warn("Authority '"+ar.getIdentifyingString()+"' is unreachable for user '"+ar.getUserID()+"'");
-            sb.append(UNREACHABLE_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");
+            sb.append(UNREACHABLE_VALUE).append(URLEncoder.encode(ar.getIdentifyingString())).append("\n");
           }
           else if (reply.getResponseStatus() == AuthorizationResponse.RESPONSE_USERUNAUTHORIZED)
           {
             if (Logging.authorityService.isDebugEnabled())
               Logging.authorityService.debug("Authority '"+ar.getIdentifyingString()+"' does not authorize user '"+ar.getUserID()+"'");
-            sb.append(UNAUTHORIZED_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");
+            sb.append(UNAUTHORIZED_VALUE).append(URLEncoder.encode(ar.getIdentifyingString())).append("\n");
           }
           else if (reply.getResponseStatus() == AuthorizationResponse.RESPONSE_USERNOTFOUND)
           {
             if (Logging.authorityService.isDebugEnabled())
               Logging.authorityService.debug("User '"+ar.getUserID()+"' unknown to authority '"+ar.getIdentifyingString()+"'");
-            sb.append(USERNOTFOUND_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");
+            sb.append(USERNOTFOUND_VALUE).append(URLEncoder.encode(ar.getIdentifyingString())).append("\n");
           }
           else
-            sb.append(AUTHORIZED_VALUE).append(java.net.URLEncoder.encode(ar.getIdentifyingString(),"UTF-8")).append("\n");
+            sb.append(AUTHORIZED_VALUE).append(URLEncoder.encode(ar.getIdentifyingString())).append("\n");
 
           String[] acl = reply.getAccessTokens();
           if (acl != null)
@@ -402,7 +404,7 @@ public class UserACLServlet extends Http
               {
                 if (Logging.authorityService.isDebugEnabled())
                   Logging.authorityService.debug("  User '"+ar.getUserID()+"' has Acl = '"+acl[j]+"' from authority '"+ar.getIdentifyingString()+"'");
-                sb.append(TOKEN_PREFIX).append(java.net.URLEncoder.encode(authGroup,"UTF-8")).append(":").append(java.net.URLEncoder.encode(acl[j++],"UTF-8")).append("\n");
+                sb.append(TOKEN_PREFIX).append(URLEncoder.encode(authGroup)).append(":").append(URLEncoder.encode(acl[j++])).append("\n");
               }
             }
           }
@@ -410,9 +412,10 @@ public class UserACLServlet extends Http
 
         // Maintained for backwards compatibility only; no practical use that I can determine here
         if (idneeded && userID != null)
-          sb.append(ID_PREFIX).append(java.net.URLEncoder.encode(userID,"UTF-8")).append("\n");
+          sb.append(ID_PREFIX).append(URLEncoder.encode(userID)).append("\n");
+
+        byte[] responseValue = sb.toString().getBytes(StandardCharsets.ISO_8859_1);
 
-        byte[] responseValue = sb.toString().getBytes("ISO8859-1");
 
         response.setIntHeader("Content-Length", (int)responseValue.length);
         out.write(responseValue,0,responseValue.length);
@@ -443,11 +446,6 @@ public class UserACLServlet extends Http
     {
       // Shut down and don't bother to respond
     }
-    catch (java.io.UnsupportedEncodingException e)
-    {
-      Logging.authorityService.error("Unsupported encoding: "+e.getMessage(),e);
-      throw new ServletException("Fatal error occurred: "+e.getMessage(),e);
-    }
     catch (ManifoldCFException e)
     {
       Logging.authorityService.error("User ACL servlet error: "+e.getMessage(),e);

Modified: manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/fuzzyml/XMLFileParsingContext.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/fuzzyml/XMLFileParsingContext.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/fuzzyml/XMLFileParsingContext.java (original)
+++ manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/fuzzyml/XMLFileParsingContext.java Fri Apr 18 23:21:23 2014
@@ -31,7 +31,7 @@ public class XMLFileParsingContext exten
 
   /** Full constructor.  Used for individual tags. */
   public XMLFileParsingContext(XMLFuzzyHierarchicalParseState theStream, String namespace, String localname, String qname, Map<String,String> theseAttributes, File f)
-    throws ManifoldCFException, UnsupportedEncodingException, FileNotFoundException
+    throws ManifoldCFException, FileNotFoundException
   {
     // Construct an appropriate writer
     super(theStream,namespace,localname,qname,theseAttributes,new FileOutputStream(f));

Modified: manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/fuzzyml/XMLOutputStreamParsingContext.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/fuzzyml/XMLOutputStreamParsingContext.java?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/fuzzyml/XMLOutputStreamParsingContext.java (original)
+++ manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/fuzzyml/XMLOutputStreamParsingContext.java Fri Apr 18 23:21:23 2014
@@ -32,7 +32,7 @@ public class XMLOutputStreamParsingConte
 
   /** Full constructor.  Used for individual tags. */
   public XMLOutputStreamParsingContext(XMLFuzzyHierarchicalParseState theStream, String namespace, String localname, String qname, Map<String,String> theseAttributes, OutputStream os)
-    throws ManifoldCFException, UnsupportedEncodingException
+    throws ManifoldCFException
   {
     // Construct an appropriate writer
     super(theStream,namespace,localname,qname,theseAttributes,new OutputStreamWriter(os, StandardCharsets.UTF_8));

Added: manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/util/URLDecoder.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/util/URLDecoder.java?rev=1588591&view=auto
==============================================================================
--- manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/util/URLDecoder.java (added)
+++ manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/util/URLDecoder.java Fri Apr 18 23:21:23 2014
@@ -0,0 +1,31 @@
+package org.apache.manifoldcf.core.util;
+
+import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * Wrapper of {@link java.net.URLDecoder}
+ * Intends to replace java.net.URLDecoder.decode(String s, "UTF-8")
+ * avoiding {@link UnsupportedEncodingException} handling.
+ * {@link StandardCharsets} are guaranteed to be available
+ * on every implementation of the Java platform.
+ *
+ * @since 1.7
+ */
+public class URLDecoder {
+
+  public static String decode(String s) {
+
+    String str = null;
+
+    try {
+      str = java.net.URLDecoder.decode(s, StandardCharsets.UTF_8.name());
+    } catch (UnsupportedEncodingException e) {
+      // Can't happen. java.nio.charset.StandardCharsets are guaranteed
+      // to be available on every implementation of the Java platform.
+      throw new RuntimeException("UTF-8 not supported " + e.getMessage(), e);
+    }
+
+    return str;
+  }
+}

Propchange: manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/util/URLDecoder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/util/URLEncoder.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/util/URLEncoder.java?rev=1588591&view=auto
==============================================================================
--- manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/util/URLEncoder.java (added)
+++ manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/util/URLEncoder.java Fri Apr 18 23:21:23 2014
@@ -0,0 +1,31 @@
+package org.apache.manifoldcf.core.util;
+
+import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * Wrapper of {@link java.net.URLEncoder}
+ * Intends to replace java.net.URLEncoder.encode(String s, "UTF-8")
+ * avoiding {@link UnsupportedEncodingException} handling.
+ * {@link StandardCharsets} are guaranteed to be available
+ * on every implementation of the Java platform.
+ *
+ * @since 1.7
+ */
+public class URLEncoder {
+
+  public static String encode(String s) {
+
+    String str = null;
+
+    try {
+      str = java.net.URLEncoder.encode(s, StandardCharsets.UTF_8.name());
+    } catch (UnsupportedEncodingException e) {
+      // Can't happen. java.nio.charset.StandardCharsets are guaranteed
+      // to be available on every implementation of the Java platform.
+      throw new RuntimeException("UTF-8 not supported " + e.getMessage(), e);
+    }
+
+    return str;
+  }
+}

Propchange: manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/util/URLEncoder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/error.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/error.jsp?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/error.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/error.jsp Fri Apr 18 23:21:23 2014
@@ -49,7 +49,7 @@
 	<table class="displaytable">
 		<tr><td class="message"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(errorText)%></td></tr>
 		<tr><td class="separator"><hr/></td></tr>
-		<tr><td class="message"><a href='<%=java.net.URLEncoder.encode(target,"UTF-8")%>' alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"error.Return")%>">OK</a></td></tr>
+		<tr><td class="message"><a href='<%=org.apache.manifoldcf.core.util.URLEncoder.encode(target)%>' alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"error.Return")%>">OK</a></td></tr>
 	</table>
 
        </td>

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listauthorities.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listauthorities.jsp?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listauthorities.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listauthorities.jsp Fri Apr 18 23:21:23 2014
@@ -99,8 +99,8 @@
 		<tr <%="class=\""+((i%2==0)?"evendatarow":"odddatarow")+"\""%>>
 			<td class="columncell">
 				<nobr>
-					<a href='<%="viewauthority.jsp?connname="+java.net.URLEncoder.encode(name,"UTF-8")%>' alt='<%="View "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.View")%></a>
-					<a href='<%="editauthority.jsp?connname="+java.net.URLEncoder.encode(name,"UTF-8")%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listauthorities.Edit")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.Edit")%></a>
+					<a href='<%="viewauthority.jsp?connname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%="View "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.View")%></a>
+					<a href='<%="editauthority.jsp?connname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listauthorities.Edit")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.Edit")%></a>
 					<a href="javascript:void()" onclick='<%="javascript:Delete(\""+org.apache.manifoldcf.ui.util.Encoder.attributeJavascriptEscape(name)+"\")"%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listauthorities.Delete")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listauthorities.Delete")%></a>
 				</nobr>
 			</td>

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listconnections.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listconnections.jsp?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listconnections.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listconnections.jsp Fri Apr 18 23:21:23 2014
@@ -95,7 +95,7 @@
 		String className = connection.getClassName();
 		String connectorName = connectorManager.getDescription(className);
 		if (connectorName == null)
-			connectorName = className + Messages.getString(pageContext.getRequest().getLocale(),"listconnections.uninstalled");;
+			connectorName = className + Messages.getString(pageContext.getRequest().getLocale(),"listconnections.uninstalled");
 		String authorityName = connection.getACLAuthority();
 		int maxCount = connection.getMaxConnections();
 
@@ -103,8 +103,8 @@
 		<tr <%="class=\""+((i%2==0)?"evendatarow":"odddatarow")+"\""%>>
 			<td class="columncell">
 				<nobr>
-					<a href='<%="viewconnection.jsp?connname="+java.net.URLEncoder.encode(name,"UTF-8")%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listconnections.View")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.View")%></a>
-					<a href='<%="editconnection.jsp?connname="+java.net.URLEncoder.encode(name,"UTF-8")%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listconnections.Edit")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.Edit")%></a>
+					<a href='<%="viewconnection.jsp?connname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listconnections.View")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.View")%></a>
+					<a href='<%="editconnection.jsp?connname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listconnections.Edit")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.Edit")%></a>
 					<a href="javascript:void()" onclick='<%="javascript:Delete(\""+org.apache.manifoldcf.ui.util.Encoder.attributeJavascriptEscape(name)+"\")"%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listconnections.Delete")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listconnections.Delete")%></a>
 				</nobr>
 			</td>

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listgroups.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listgroups.jsp?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listgroups.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listgroups.jsp Fri Apr 18 23:21:23 2014
@@ -94,8 +94,8 @@
 		<tr <%="class=\""+((i%2==0)?"evendatarow":"odddatarow")+"\""%>>
 			<td class="columncell">
 				<nobr>
-					<a href='<%="viewgroup.jsp?groupname="+java.net.URLEncoder.encode(name,"UTF-8")%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listgroups.View")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listgroups.View")%></a>
-					<a href='<%="editgroup.jsp?groupname="+java.net.URLEncoder.encode(name,"UTF-8")%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listgroups.Edit")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listgroups.Edit")%></a>
+					<a href='<%="viewgroup.jsp?groupname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listgroups.View")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listgroups.View")%></a>
+					<a href='<%="editgroup.jsp?groupname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listgroups.Edit")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listgroups.Edit")%></a>
 					<a href="javascript:void()" onclick='<%="javascript:Delete(\""+org.apache.manifoldcf.ui.util.Encoder.attributeJavascriptEscape(name)+"\")"%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listgroups.Delete")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listgroups.Delete")%></a>
 				</nobr>
 			</td>

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listmappers.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listmappers.jsp?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listmappers.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listmappers.jsp Fri Apr 18 23:21:23 2014
@@ -102,8 +102,8 @@
 		<tr <%="class=\""+((i%2==0)?"evendatarow":"odddatarow")+"\""%>>
 			<td class="columncell">
 				<nobr>
-					<a href='<%="viewmapper.jsp?connname="+java.net.URLEncoder.encode(name,"UTF-8")%>' alt='<%="View "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.View")%></a>
-					<a href='<%="editmapper.jsp?connname="+java.net.URLEncoder.encode(name,"UTF-8")%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listmappers.Edit")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.Edit")%></a>
+					<a href='<%="viewmapper.jsp?connname="+URLEncoder.encode(name)%>' alt='<%="View "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.View")%></a>
+					<a href='<%="editmapper.jsp?connname="+URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listmappers.Edit")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.Edit")%></a>
 					<a href="javascript:void()" onclick='<%="javascript:Delete(\""+org.apache.manifoldcf.ui.util.Encoder.attributeJavascriptEscape(name)+"\")"%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listmappers.Delete")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listmappers.Delete")%></a>
 				</nobr>
 			</td>

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listoutputs.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listoutputs.jsp?rev=1588591&r1=1588590&r2=1588591&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listoutputs.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listoutputs.jsp Fri Apr 18 23:21:23 2014
@@ -101,8 +101,8 @@
 		<tr <%="class=\""+((i%2==0)?"evendatarow":"odddatarow")+"\""%>>
 			<td class="columncell">
 				<nobr>
-					<a href='<%="viewoutput.jsp?connname="+java.net.URLEncoder.encode(name,"UTF-8")%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listoutputs.View")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listoutputs.View")%></a>
-					<a href='<%="editoutput.jsp?connname="+java.net.URLEncoder.encode(name,"UTF-8")%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listoutputs.Edit")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listoutputs.Edit")%></a>
+					<a href='<%="viewoutput.jsp?connname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listoutputs.View")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listoutputs.View")%></a>
+					<a href='<%="editoutput.jsp?connname="+org.apache.manifoldcf.core.util.URLEncoder.encode(name)%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listoutputs.Edit")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listoutputs.Edit")%></a>
 					<a href="javascript:void()" onclick='<%="javascript:Delete(\""+org.apache.manifoldcf.ui.util.Encoder.attributeJavascriptEscape(name)+"\")"%>' alt='<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"listoutputs.Delete")+" "+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)%>'><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"listoutputs.Delete")%></a>
 				</nobr>
 			</td>



Mime
View raw message