jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r708876 - /jackrabbit/sandbox/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
Date Wed, 29 Oct 2008 11:12:36 GMT
Author: angela
Date: Wed Oct 29 04:12:36 2008
New Revision: 708876

URL: http://svn.apache.org/viewvc?rev=708876&view=rev
Log:
avoid usage of HttpMethodBase.getResponseBodyAsString() that logs warning in case of unknown
content length or content-length > BUFFER_WARN_TRIGGER_LIMIT

Modified:
    jackrabbit/sandbox/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java

Modified: jackrabbit/sandbox/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java?rev=708876&r1=708875&r2=708876&view=diff
==============================================================================
--- jackrabbit/sandbox/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
(original)
+++ jackrabbit/sandbox/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
Wed Oct 29 04:12:36 2008
@@ -179,6 +179,8 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
+import java.io.Reader;
+import java.io.InputStreamReader;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -968,7 +970,13 @@
                 if (type == PropertyType.BINARY) {
                     v = getQValueFactory().create(method.getResponseBodyAsStream());
                 } else {
-                    Value jcrValue = valueFactory.createValue(method.getResponseBodyAsString(),
type);
+                    Reader reader = new InputStreamReader(method.getResponseBodyAsStream(),
method.getResponseCharSet());
+                    StringBuffer sb = new StringBuffer();
+                    int c;
+                    while ((c = reader.read()) > -1) {
+                        sb.append((char) c);
+                    }
+                    Value jcrValue = valueFactory.createValue(sb.toString(), type);
                     if (jcrValue instanceof QValueValue) {
                         v = ((QValueValue) jcrValue).getQValue();
                     } else {



Mime
View raw message