manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From piergior...@apache.org
Subject svn commit: r1384229 - in /manifoldcf/trunk: CHANGES.txt connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
Date Thu, 13 Sep 2012 08:32:21 GMT
Author: piergiorgio
Date: Thu Sep 13 08:32:20 2012
New Revision: 1384229

URL: http://svn.apache.org/viewvc?rev=1384229&view=rev
Log:
fixed CMIS ingestion for nodes without binary content (CONNECTORS-527)

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1384229&r1=1384228&r2=1384229&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Thu Sep 13 08:32:20 2012
@@ -3,6 +3,9 @@ $Id$
 
 ======================= 0.7-dev =====================
 
+CONNECTORS-527: Error during CMIS ingestion of nodes without binary content
+(Piergiorgio Lucidi)
+
 CONNECTORS-518: Add Wiki protected content access support to the
 Wiki Connector.  Thanks to Maciej Lizewski for this contribution.
 (Maciej Lizewski, Karl Wright)

Modified: manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java?rev=1384229&r1=1384228&r2=1384229&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
(original)
+++ manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
Thu Sep 13 08:32:20 2012
@@ -28,7 +28,6 @@ import java.rmi.RemoteException;
 import java.text.SimpleDateFormat;
 import java.util.GregorianCalendar;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -1066,14 +1065,16 @@ public class CmisRepositoryConnector ext
 
         Document document = (Document) cmisObject;
         long fileLength = document.getContentStreamLength();
-
-        InputStream is = document.getContentStream().getStream();
-
+        InputStream is = null;
+        
         try {
           RepositoryDocument rd = new RepositoryDocument();
           
           //binary
-          rd.setBinary(is, fileLength);
+          if(fileLength>0 && document.getContentStream()!=null){
+            is = document.getContentStream().getStream();
+            rd.setBinary(is, fileLength);
+          }
 
           //properties
           List<Property<?>> properties = document.getProperties();
@@ -1175,7 +1176,9 @@ public class CmisRepositoryConnector ext
 
         } finally {
           try {
-            is.close();
+            if(is!=null){
+              is.close();
+            }
           } catch (InterruptedIOException e) {
             errorCode = "Interrupted error";
             errorDesc = e.getMessage();



Mime
View raw message