Author: kwright
Date: Fri Nov 3 20:14:35 2017
New Revision: 1814235
URL: http://svn.apache.org/viewvc?rev=1814235&view=rev
Log:
Fix for CONNECTORS-1471. Committed on behalf of David Hotchkiss.
Modified:
manifoldcf/trunk/CHANGES.txt
manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java
Modified: manifoldcf/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1814235&r1=1814234&r2=1814235&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Fri Nov 3 20:14:35 2017
@@ -3,6 +3,10 @@ $Id$
======================= 2.9-dev =====================
+CONNECTORS-1471: File system output connector's delete method
+was completely broken.
+(David Hotchkiss)
+
CONNECTORS-1469: The slack notification connector is now properly
integrated into the maven build.
(Markus Schuch)
Modified:
manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java
URL:
http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java?rev=1814235&r1=1814234&r2=1814235&view=diff
==============================================================================
---
manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java
(original)
+++
manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java
Fri Nov 3 20:14:35 2017
@@ -377,9 +377,15 @@ public class FileOutputConnector extends
FileOutputConfig config = getConfigParameters(null);
+ FileOutputSpecs specs = new FileOutputSpecs(outputDescription);
+
StringBuffer path = new StringBuffer();
try {
+ if(specs.getRootPath() != null) {
+ path.append(specs.getRootPath());
+ }
+
// We cannot remove documents, because it is unsafe to do so.
// Paths that were created when the document existed will not
// be found if it goes away. So we have to leave a grave marker,
@@ -780,6 +786,22 @@ public class FileOutputConnector extends
private final String rootPath;
+ /** Build a set of parameters from a packed version string.
+ *
+ * @param versionString composed of "packed" output specification
parameters.
+ * @throws ManifoldCFException
+ */
+ public FileOutputSpecs(String versionString) throws ManifoldCFException {
+ super(SPECIFICATIONLIST);
+ int index = 0;
+ for (ParameterEnum param : SPECIFICATIONLIST) {
+ StringBuilder sb = new StringBuilder();
+ index = unpack(sb, versionString, index, '+');
+ put(param, sb.toString());
+ }
+ this.rootPath = this.getRootPath();
+ }
+
/** Build a set of ElasticSearch parameters by reading an instance of
* SpecificationNode.
*