You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2008/05/05 12:16:45 UTC
svn commit: r653413 -
/incubator/sling/trunk/jcr/contentloader/src/main/java/org/apache/sling/jcr/contentloader/internal/JsonReader.java
Author: cziegeler
Date: Mon May 5 03:16:45 2008
New Revision: 653413
URL: http://svn.apache.org/viewvc?rev=653413&view=rev
Log:
SLING-412: Remove support for "name" property which defines the name of the root node imported through json.
Modified:
incubator/sling/trunk/jcr/contentloader/src/main/java/org/apache/sling/jcr/contentloader/internal/JsonReader.java
Modified: incubator/sling/trunk/jcr/contentloader/src/main/java/org/apache/sling/jcr/contentloader/internal/JsonReader.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/contentloader/src/main/java/org/apache/sling/jcr/contentloader/internal/JsonReader.java?rev=653413&r1=653412&r2=653413&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/contentloader/src/main/java/org/apache/sling/jcr/contentloader/internal/JsonReader.java (original)
+++ incubator/sling/trunk/jcr/contentloader/src/main/java/org/apache/sling/jcr/contentloader/internal/JsonReader.java Mon May 5 03:16:45 2008
@@ -59,7 +59,7 @@
return jsonReader;
}
};
-
+
public NodeDescription parse(InputStream ins) throws IOException {
try {
String jsonString = toString(ins).trim();
@@ -68,8 +68,7 @@
}
JSONObject json = new JSONObject(jsonString);
- String name = json.optString("name", null); // allow for no name !
- return this.createNode(name, json);
+ return this.createNode(null, json);
} catch (JSONException je) {
throw (IOException) new IOException(je.getMessage()).initCause(je);
@@ -156,12 +155,12 @@
// fall back to default
return PropertyType.TYPENAME_STRING;
}
-
+
private String toString(InputStream ins) throws IOException {
if (!ins.markSupported()) {
ins = new BufferedInputStream(ins);
}
-
+
String encoding;
ins.mark(5);
int c = ins.read();
@@ -184,7 +183,7 @@
bos.write(buf, 0, rd);
}
bos.close(); // just to comply with the contract
-
+
return new String(bos.toByteArray(), encoding);
}
}