manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1452486 - /manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java
Date Mon, 04 Mar 2013 20:30:14 GMT
Author: kwright
Date: Mon Mar  4 20:30:14 2013
New Revision: 1452486

URL: http://svn.apache.org/r1452486
Log:
Set modified date metadata.  Part of CONNECTORS-657.

Modified:
    manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java

Modified: manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java?rev=1452486&r1=1452485&r2=1452486&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java
(original)
+++ manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java
Mon Mar  4 20:30:14 2013
@@ -3544,7 +3544,10 @@ public class WikiConnector extends org.a
                 if (title != null)
                   rd.addField("title",title);
                 if (lastModified != null)
+                {
                   rd.addField("last-modified",lastModified);
+                  rd.setModifiedDate(parseISODate(lastModified));
+                }
 
                 if (allowACL != null && allowACL.length > 0) {
                   String[] denyACL = new String[]{
@@ -3656,6 +3659,19 @@ public class WikiConnector extends org.a
     }
   }
   
+  protected static Date parseISODate(String isoDateValue)
+  {
+    java.text.DateFormat iso8601Format = new java.text.SimpleDateFormat ("yyyy-MM-dd'T'HH:mm:ssZ");
+    try
+    {
+      return iso8601Format.parse(isoDateValue);
+    }
+    catch (java.text.ParseException e)
+    {
+      return null;
+    }
+  }
+  
   /** Thread to execute a "get doc info" operation.  This thread both executes the operation
and parses the result. */
   protected static class ExecuteGetDocInfoThread extends Thread
   {



Mime
View raw message