Fix spaces in Site names in more places

All the methods of SoapFactory could end up being passed URLs with
spaces, so we need to deal with spaces on each. However, using
spUrlToUri() within SoapFactory is misplaced because that should not be
the SoapFactory's responsibility. Thus, we move spUrlToUri() to all the
callers of the SoapFactory.

Unfortunately that means that testing spaces in Site names becomes much
harder and we remove a test case because it is too hard to replicate at
this time.
diff --git a/src/com/google/enterprise/adaptor/sharepoint/SharePointAdaptor.java b/src/com/google/enterprise/adaptor/sharepoint/SharePointAdaptor.java
index 438281d..f8ef371 100644
--- a/src/com/google/enterprise/adaptor/sharepoint/SharePointAdaptor.java
+++ b/src/com/google/enterprise/adaptor/sharepoint/SharePointAdaptor.java
@@ -328,8 +328,8 @@
     Authenticator.setDefault(ntlmAuthenticator);
     URL virtualServerUrl = new URL(virtualServer);
     ntlmAuthenticator.addPermitForHost(virtualServerUrl);
-    String authenticationEndPoint 
-        =  virtualServer + "/_vti_bin/Authentication.asmx";
+    String authenticationEndPoint = spUrlToUri(
+        virtualServer + "/_vti_bin/Authentication.asmx").toString();
     authenticationHandler = new FormsAuthenticationHandler(username,
         password, scheduledExecutor,
         soapFactory.newAuthentication(authenticationEndPoint));
@@ -577,12 +577,14 @@
         site = site.substring(0, site.length() - 1);
       }
       ntlmAuthenticator.addPermitForHost(new URL(web));
-      String endpoint = web + "/_vti_bin/SiteData.asmx";
+      String endpoint = spUrlToUri(web + "/_vti_bin/SiteData.asmx").toString();
       SiteDataSoap siteDataSoap = soapFactory.newSiteData(endpoint);
       
-      String endpointUserGroup = site + "/_vti_bin/UserGroup.asmx";
+      String endpointUserGroup = spUrlToUri(site + "/_vti_bin/UserGroup.asmx")
+          .toString();
       UserGroupSoap userGroupSoap = soapFactory.newUserGroup(endpointUserGroup);
-      String endpointPeople = site + "/_vti_bin/People.asmx";
+      String endpointPeople = spUrlToUri(site + "/_vti_bin/People.asmx")
+          .toString();
       PeopleSoap peopleSoap = soapFactory.newPeople(endpointPeople);
       // JAX-WS RT 2.1.4 doesn't handle headers correctly and always assumes the
       // list contains precisely one entry, so we work around it here.
@@ -2123,7 +2125,7 @@
      * The {@code endpoint} string is a SharePoint URL, meaning that spaces are
      * not encoded.
      */
-    public SiteDataSoap newSiteData(String endpoint) throws IOException;
+    public SiteDataSoap newSiteData(String endpoint);
 
     public UserGroupSoap newUserGroup(String endpoint);
     
@@ -2158,10 +2160,9 @@
     }
 
     @Override
-    public SiteDataSoap newSiteData(String endpoint) throws IOException {
+    public SiteDataSoap newSiteData(String endpoint) {
       EndpointReference endpointRef = new W3CEndpointReferenceBuilder()
-          .address(handleEncoding(SharePointAdaptor.spUrlToUri(endpoint)
-            .toString())).build();
+          .address(handleEncoding(endpoint)).build();
       return siteDataService.getPort(endpointRef, SiteDataSoap.class);
     }
 
diff --git a/test/com/google/enterprise/adaptor/sharepoint/SharePointAdaptorTest.java b/test/com/google/enterprise/adaptor/sharepoint/SharePointAdaptorTest.java
index 7045ce7..170ccbc 100644
--- a/test/com/google/enterprise/adaptor/sharepoint/SharePointAdaptorTest.java
+++ b/test/com/google/enterprise/adaptor/sharepoint/SharePointAdaptorTest.java
@@ -275,9 +275,6 @@
         = new SharePointAdaptor.SoapFactoryImpl();
     assertNotNull(
         sdfi.newSiteData("http://localhost:1/_vti_bin/SiteData.asmx"));
-    // Test a site with a space.
-    assertNotNull(sdfi.newSiteData(
-        "http://localhost:1/Site with space/_vti_bin/SiteData.asmx"));
   }
 
   @Test