Hi Florian, thank you for your help. I have used the in-memory repository (Jens has already fixed it).
Best Regards, Achim -----Original Message----- From: Florian Müller [mailto:[email protected]] Sent: Dienstag, 22. Juni 2010 10:12 To: [email protected] Subject: RE: OpenCMIS Client API: Questions about fetching content Hi Achim, Here are a few answers to your questions: > - Which exception should be thrown at the method Document.getStream() if no > content exists? Currently we get a CmisNotSupportedException but > according to the CMIS specification we would have expected a > CmisConstraintException exception. That sounds like a repository bug. Which repository you are using? > - What is the expected behavior of the method > Document.getContentStreamLength() in that case? Currently -1 is returned. > Has this number some special semantic like "unknown"? Why is not 0 returned? The content stream length is a bad indicator for content. You should use the property cmis:contentStreamFileName to check if the document has content or not. OpenCMIS returns -1 for the stream length because it has return an integer and it's an invalid length. The length 0 indicates that there is an empty content (0 bytes) that has a file name and a MIME type. > - What is the expected behavior of the method > Document.getContentStreamMimeType() in that case? Currently null is returned. That's the expected behavior. If there is no content stream the property cmis:contentStreamMimeType should not be set - which translates to null in Java. > - How could I find out the encoding of content? The encoding is part of the MIME type, if the repository set it. Cheers, Florian
