Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
In the Creating a document example available at the following page:
http://chemistry.apache.org/java/examples/example-create-update.html
I found this snippet dedicated to create the content stream:
// content byte[] content = "Hello World!".getBytes(); InputStream stream = new ByteArrayInputStream(content); ContentStream contentStream = new ContentStreamImpl(name, content.length, "text/plain", stream);
But I think that it is wrong, trying to execute the snippet on OpenCMIS 0.4.0, the right way to create a content is the following:
// content byte[] content = "Hello World!".getBytes(); InputStream stream = new ByteArrayInputStream(content); ContentStream contentStream = new ContentStreamImpl(name, new BigInteger(content), "text/plain", stream);
The second argument of the ContentStreamImpl constructor must be a BigInteger, in the example shown in the website content.length return an int value that can't be used correctly.