manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1383994 - /manifoldcf/branches/CONNECTORS-518/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java
Date Wed, 12 Sep 2012 15:04:48 GMT
Author: kwright
Date: Wed Sep 12 15:04:47 2012
New Revision: 1383994

URL: http://svn.apache.org/viewvc?rev=1383994&view=rev
Log:
Fix broken end-of-list detection.

Modified:
    manifoldcf/branches/CONNECTORS-518/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java

Modified: manifoldcf/branches/CONNECTORS-518/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-518/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java?rev=1383994&r1=1383993&r2=1383994&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-518/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java
(original)
+++ manifoldcf/branches/CONNECTORS-518/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java
Wed Sep 12 15:04:47 2012
@@ -481,7 +481,7 @@ public class WikiConnector extends org.a
     }
   }
 
-  protected class APILoginResult {
+  protected static class APILoginResult {
 
     public boolean result = false;
     public String reason = "";
@@ -2138,6 +2138,11 @@ public class WikiConnector extends org.a
     }
   }
 
+  protected static class ReturnString
+  {
+    public String returnValue = null;
+  }
+  
   /** Thread to execute a list pages operation */
   protected static class ExecuteListPagesThread extends Thread
   {
@@ -2171,9 +2176,9 @@ public class WikiConnector extends org.a
         InputStream is = executeMethod.getResponseBodyAsStream();
         try
         {
-          StringBuilder lastPageTitleBuffer = new StringBuilder();
-          loginNeeded = parseListPagesResponse(is,pageBuffer,startPageTitle,lastPageTitleBuffer);
-          lastPageTitle = lastPageTitleBuffer.toString();
+          ReturnString returnString = new ReturnString();
+          loginNeeded = parseListPagesResponse(is,pageBuffer,startPageTitle,returnString);
+          lastPageTitle = returnString.returnValue;
         }
         finally
         {
@@ -2229,7 +2234,7 @@ public class WikiConnector extends org.a
   *   </query-continue>
   * </api>
   */
-  protected static boolean parseListPagesResponse(InputStream is, PageBuffer buffer, String
startPageTitle, StringBuilder lastTitle)
+  protected static boolean parseListPagesResponse(InputStream is, PageBuffer buffer, String
startPageTitle, ReturnString lastTitle)
     throws ManifoldCFException, ServiceInterruption
   {
     // Parse the document.  This will cause various things to occur, within the instantiated
XMLContext class.
@@ -2242,8 +2247,7 @@ public class WikiConnector extends org.a
       {
         x.parse(is);
         String lastTitleString = c.getLastTitle();
-        if (lastTitleString != null)
-          lastTitle.append(lastTitleString);
+        lastTitle.returnValue = lastTitleString;
         return c.isLoginRequired();
       }
       catch (IOException e)



Mime
View raw message