Uploaded image for project: 'ManifoldCF'
  1. ManifoldCF
  2. CONNECTORS-1462

Add support for rootPath attribute in File System Connector repository

    XMLWordPrintableJSON

Details

    • Patch

    Description

      In recent conversations about specific needs of the new output connectors (in this case for the Alfresco BFSI Output connector) a new construct was added in RepositoryDocument to support having a rootPath attribute under the document object. This new construct exists currently only in CONNECTORS-1356-2.7.1 branch.

      This issue addresses the changes necessary to the File System Connector to support the new construct and inject the rootPath locations into RepositoryDocument.

      ------------
      Changes
      ------------
      org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector.java

        // Extract rootPath from the specification
          ArrayList<String> rootPath = new ArrayList<String>();
          for (int i = 0; i < spec.getChildCount(); i++)
          {
            SpecificationNode sn = spec.getChild(i);
            if (sn.getType().equals("startpoint"))
            {
              String path = sn.getAttributeValue("path").replaceAll("\\\\","/");
              if (path.length() > 0)
              {
                if (!path.endsWith("/")) path += "/";
                rootPath.add(path);
                break;
              }
            }
          }
      

      ...

              RepositoryDocument data = new RepositoryDocument();
              data.setFileName(fileName);
              data.setMimeType(mimeType);
              data.setModifiedDate(modifiedDate);
              data.setRootPath(rootPath); // Adding the rootPath to RepositoryDocument
      

      Attachments

        1. CONNECTORS-1462.patch
          3 kB
          Luis Cabaceira
        2. FileConnector.java
          54 kB
          Luis Cabaceira

        Activity

          People

            piergiorgiolucidi@gmail.com Piergiorgio Lucidi
            lcabaceira Luis Cabaceira
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified