cancel
Showing results for 
Search instead for 
Did you mean: 

Bugged node.getProperty('cm:content').getStream().

alexeyg
Champ in-the-making
Champ in-the-making
Is this a bug or am I missing something?

Property content = pathNode.getProperty("cm:content");
InputStream in = content.getStream();
System.out.println("in.avalable() = " + in.available());
System.out.println("content.getLength() = " + content.getLength());

feeding node with GIF image to code above
output:

in.avalable() = 0
content.getLength() = 2955

thank you
2 REPLIES 2

derek
Star Contributor
Star Contributor
Hi,

It looks as if the content is not available to the repo.  Typically this happens because the dir.root property has not been set to a fixed location and the tests get run against the same database but from different locations.  So the metadata is all there with the size and URL, but the stream is empty.

http://www.alfresco.org/mediawiki/index.php/Development_Environment#Developer_Runtime_Configuration

It's just a guess, though.
Regards

tezzzzz
Champ in-the-making
Champ in-the-making
I know that this is after very long time. I have uploaded a file and modified my code to download the same. This simply says that my dir.root has not been changed bcoz I am working on same project. Stuck with number zero even now Smiley Sad Im using Alfresco 3.4d version. Please do help on how to download the uploaded files. I am able to see the metadata and contentLength() but stream.available is returning zero.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.