You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ra...@apache.org on 2019/07/22 09:43:56 UTC
[sling-org-apache-sling-contentparser-json] 02/08: SLING-8570 -
Extract a generic Content Parser API from
org.apache.sling.jcr.contentparser with pluggable implementations
This is an automated email from the ASF dual-hosted git repository.
radu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-contentparser-json.git
commit f77d16d0ee91cfc23731e60eb96c4013650db18b
Author: Radu Cotescu <ra...@apache.org>
AuthorDate: Thu Jul 11 15:23:46 2019 +0200
SLING-8570 - Extract a generic Content Parser API from org.apache.sling.jcr.contentparser with pluggable implementations
* pom clean-up
* replaced a deprecated import and removed an unused one
---
pom.xml | 18 +++++++-----------
.../contentparser/json/internal/JsonContentParser.java | 5 ++---
2 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/pom.xml b/pom.xml
index a33598b..3fc188b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,35 +17,31 @@
specific language governing permissions and limitations
under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling-bundle-parent</artifactId>
<version>35</version>
- <relativePath />
+ <relativePath/>
</parent>
<artifactId>org.apache.sling.contentparser.json</artifactId>
<version>0.9.0-SNAPSHOT</version>
- <name>Apache Sling Content Parser API</name>
+ <name>Apache Sling Content Parser for JSON</name>
<description>
- Parser API Apache Sling Resource trees stored in files (e.g. JSON, FileVault XML, etc.).
+ Apache Sling Content Parser for resource trees stored in JSON files
</description>
<scm>
<connection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-contentparser-json.git</connection>
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-contentparser-json.git</developerConnection>
<url>https://gitbox.apache.org/repos/asf?p=sling-org-apache-sling-contentparser-json.git</url>
- <tag>HEAD</tag>
- </scm>
+ <tag>HEAD</tag>
+ </scm>
- <build>
- <plugins>
-
- </plugins>
- </build>
<dependencies>
<dependency>
<groupId>org.apache.sling</groupId>
diff --git a/src/main/java/org/apache/sling/contentparser/json/internal/JsonContentParser.java b/src/main/java/org/apache/sling/contentparser/json/internal/JsonContentParser.java
index 16d47e0..33f048e 100644
--- a/src/main/java/org/apache/sling/contentparser/json/internal/JsonContentParser.java
+++ b/src/main/java/org/apache/sling/contentparser/json/internal/JsonContentParser.java
@@ -21,11 +21,11 @@ package org.apache.sling.contentparser.json.internal;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
+import java.nio.charset.StandardCharsets;
import java.util.Calendar;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
-import java.util.Locale;
import java.util.Map;
import java.util.Set;
@@ -40,7 +40,6 @@ import javax.json.JsonValue;
import javax.json.stream.JsonParsingException;
import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.CharEncoding;
import org.apache.sling.contentparser.api.ContentHandler;
import org.apache.sling.contentparser.api.ContentParser;
import org.apache.sling.contentparser.api.JsonParserFeature;
@@ -88,7 +87,7 @@ public class JsonContentParser implements ContentParser {
private JsonObject toJsonObjectWithJsonTicks(JsonReaderFactory jsonReaderFactory, InputStream is) {
String jsonString;
try {
- jsonString = IOUtils.toString(is, CharEncoding.UTF_8);
+ jsonString = IOUtils.toString(is, StandardCharsets.UTF_8);
} catch (IOException ex) {
throw new ParseException("Error getting JSON string.", ex);
}