manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1630114 - /manifoldcf/branches/CONNECTORS-1067/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraRepositoryConnector.java
Date Wed, 08 Oct 2014 14:11:41 GMT
Author: kwright
Date: Wed Oct  8 14:11:41 2014
New Revision: 1630114

URL: http://svn.apache.org/r1630114
Log:
Update jira connector

Modified:
    manifoldcf/branches/CONNECTORS-1067/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraRepositoryConnector.java

Modified: manifoldcf/branches/CONNECTORS-1067/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1067/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraRepositoryConnector.java?rev=1630114&r1=1630113&r2=1630114&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1067/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraRepositoryConnector.java
(original)
+++ manifoldcf/branches/CONNECTORS-1067/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraRepositoryConnector.java
Wed Oct  8 14:11:41 2014
@@ -990,6 +990,31 @@ public class JiraRepositoryConnector ext
                   + documentIdentifier + "'");
             }
 
+            // Now do standard stuff
+              
+            String mimeType = "text/plain";
+            Date createdDate = jiraFile.getCreatedDate();
+            Date modifiedDate = jiraFile.getUpdatedDate();
+            String documentURI = composeDocumentURI(getBaseUrl(session), jiraFile.getKey());
+
+            if (!activities.checkURLIndexable(documentURI))
+            {
+              activities.noDocument(documentIdentifier, versionString);
+              continue;
+            }
+            
+            if (!activities.checkMimeTypeIndexable(mimeType))
+            {
+              activities.noDocument(documentIdentifier, versionString);
+              continue;
+            }
+            
+            if (!activities.checkDateIndexable(modifiedDate))
+            {
+              activities.noDocument(documentIdentifier, versionString);
+              continue;
+            }
+            
             //otherwise process
             RepositoryDocument rd = new RepositoryDocument();
               
@@ -1001,12 +1026,6 @@ public class JiraRepositoryConnector ext
               denyAclsToUse = new String[0];
             rd.setSecurity(RepositoryDocument.SECURITY_TYPE_DOCUMENT,aclsToUse,denyAclsToUse);
 
-            // Now do standard stuff
-              
-            String mimeType = "text/plain";
-            Date createdDate = jiraFile.getCreatedDate();
-            Date modifiedDate = jiraFile.getUpdatedDate();
-
             rd.setMimeType(mimeType);
             if (createdDate != null)
               rd.setCreatedDate(createdDate);
@@ -1024,13 +1043,20 @@ public class JiraRepositoryConnector ext
               rd.addField(entry.getKey(), entry.getValue());
             }
 
-            String documentURI = composeDocumentURI(getBaseUrl(session), jiraFile.getKey());
             String document = getJiraBody(jiraFile);
             try {
               byte[] documentBytes = document.getBytes(StandardCharsets.UTF_8);
+              long fileLength = documentBytes.length;
+              
+              if (!activities.checkLengthIndexable(fileLength))
+              {
+                activities.noDocument(documentIdentifier, versionString);
+                continue;
+              }
+                
               InputStream is = new ByteArrayInputStream(documentBytes);
               try {
-                rd.setBinary(is, documentBytes.length);
+                rd.setBinary(is, fileLength);
                 activities.ingestDocumentWithException(documentIdentifier, versionString,
documentURI, rd);
                 // No errors.  Record the fact that we made it.
                 errorCode = "OK";



Mime
View raw message