Achim Derigs created CMIS-771:
---------------------------------
Summary: deleteTree via compressed (gzipped) JSON fails with:
Unexpected token END OF FILE at position 0.
Key: CMIS-771
URL: https://issues.apache.org/jira/browse/CMIS-771
Project: Chemistry
Issue Type: Bug
Components: opencmis-client
Affects Versions: OpenCMIS 0.10.0
Environment: (Apache) Web server configured to compress (gzip)
responses for (Android) clients
Reporter: Achim Derigs
Priority: Minor
Fix For: OpenCMIS 1.0.0, OpenCMIS 0.11.0
Since HTTP's Content-Length header returns the compressed size, it is an error
to use getContentLength() to size buffers for the uncompressed data. Instead,
read bytes from the response until InputStream.read() returns -1. See:
http://android-developers.blogspot.de/2011/09/androids-http-clients.html
If the Web Server decides to compress the response of the deleteTree request
you will get a Content-Length of 20 for a compressed (gzipped) empty body. This
makes no sense but is valid. ;-)
org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException:
Parsing exception!
at
org.apache.chemistry.opencmis.client.bindings.spi.browser.AbstractBrowserBindingService.parse(AbstractBrowserBindingService.java:325)
at
org.apache.chemistry.opencmis.client.bindings.spi.browser.AbstractBrowserBindingService.parseObject(AbstractBrowserBindingService.java:289)
at
org.apache.chemistry.opencmis.client.bindings.spi.browser.ObjectServiceImpl.deleteTree(ObjectServiceImpl.java:506)
at
org.alfresco.mobile.android.api.services.impl.AbstractDocumentFolderServiceImpl.delete(AbstractDocumentFolderServiceImpl.java:684)
at
org.alfresco.mobile.android.api.services.impl.AbstractDocumentFolderServiceImpl.deleteNode(AbstractDocumentFolderServiceImpl.java:646)
... 2 more
Caused by: Unexpected token END OF FILE at position 0.
at
org.apache.chemistry.opencmis.commons.impl.json.parser.JSONParser.parse(JSONParser.java:273)
at
org.apache.chemistry.opencmis.client.bindings.spi.browser.AbstractBrowserBindingService.parse(AbstractBrowserBindingService.java:323)
... 6 more
--
This message was sent by Atlassian JIRA
(v6.2#6252)