From: Adam R. <ad...@ex...> - 2009-05-27 19:51:49
|
> Thanks for your reply. I had stored it as a binary file which is the first > approach you had listed in which was attempted by doing using such: > http://www.nabble.com/file/p23749184/eXimg.java eXimg.java Such an approach should be fine, I am afraid I dont have time to debug your code - but there is no reason why you shouldnt be able to read from REST in Java using a URLConnection. Personally I would never rely on URLConnection.getContentLength() - that might well be your problem. You may also find it easier to use the Apache Commons HTTPClient for this sorta thing, I know that I do! > Unfortunately, it came back with an empty byte array but it was able to > register the MIME type though I think it probably simply read it off of the > URL rather than analyzing the actual file. No the mimetype is always set by eXist reading what was stored when the file was stored and setting it appropriately on the http response. > The second option in which the information being written on the document is > not viable since the PM's overall design of the project required it to be > stored as binary and not in the xml document. > > I'm hoping that there is a function that perhaps I'm missing in the API that > will allow for a stream to return so as to use it in the output of the file. I think your code should work - there are probably just some bugs in there that you need to iron out! |