Author: kwright
Date: Fri Mar 24 11:41:46 2017
New Revision: 1788413
URL: http://svn.apache.org/viewvc?rev=1788413&view=rev
Log:
More changes
Modified:
manifoldcf/branches/CONNECTORS-1399/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java
manifoldcf/branches/CONNECTORS-1399/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/Configuration.java
Modified:
manifoldcf/branches/CONNECTORS-1399/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java
URL:
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1399/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java?rev=1788413&r1=1788412&r2=1788413&view=diff
==============================================================================
---
manifoldcf/branches/CONNECTORS-1399/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java
(original)
+++
manifoldcf/branches/CONNECTORS-1399/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java
Fri Mar 24 11:41:46 2017
@@ -54,7 +54,6 @@ import org.apache.manifoldcf.core.interf
import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
import org.apache.manifoldcf.core.interfaces.SpecificationNode;
import org.apache.manifoldcf.core.interfaces.VersionContext;
-import org.json.JSONException;
public class FileOutputConnector extends BaseOutputConnector {
@@ -331,12 +330,6 @@ public class FileOutputConnector extends
return DOCUMENTSTATUS_ACCEPTED;
}
- protected static void handleJSONException(JSONException e)
- throws ManifoldCFException, ServiceInterruption {
- Logging.agents.error("FileSystem: JSONException: "+e.getMessage(),e);
- throw new ManifoldCFException(e.getMessage(),e);
- }
-
protected static void handleURISyntaxException(URISyntaxException e)
throws ManifoldCFException, ServiceInterruption {
Logging.agents.error("FileSystem: URISyntaxException: "+e.getMessage(),e);
Modified:
manifoldcf/branches/CONNECTORS-1399/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/Configuration.java
URL:
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1399/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/Configuration.java?rev=1788413&r1=1788412&r2=1788413&view=diff
==============================================================================
---
manifoldcf/branches/CONNECTORS-1399/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/Configuration.java
(original)
+++
manifoldcf/branches/CONNECTORS-1399/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/Configuration.java
Fri Mar 24 11:41:46 2017
@@ -775,7 +775,9 @@ public class Configuration implements IH
private JSONObject currentObject = null;
private JSONArray currentArray = null;
private String currentKey = null;
+
private JSONObject finalObject = null;
+ private JSONArray finalArray = null;
public JSONWriter() {
}
@@ -826,15 +828,18 @@ public class Configuration implements IH
} else if (currentArray != null) {
currentArray.add(array);
} else {
- throw new IllegalStateException("Top level entity can't be an array");
+ finalArray = array;
}
}
public String toString() {
- if (finalObject == null) {
+ if (finalObject != null) {
+ return finalObject.toJSONString();
+ } else if (finalArray != null) {
+ return finalArray.toJSONString();
+ } else {
return "";
}
- return finalObject.toJSONString();
}
protected void pushState() {