This discussion is archived
7 Replies Latest reply: Feb 12, 2013 6:05 AM by FabianScherpenzeel RSS

Any way to distinguish the failure and normal when get document from UCM?

Aacc Newbie
Currently Being Moderated
Hi,

I'm using the following GET_FILE service to get document from UCM

request.putLocal(IdcService.NAME, IdcService.GET_FILE);
request.putLocal(IdcDocumentAttribute.DOCUMENT_ID, dID);
request.putLocal(IdcDocumentAttribute.NAME, dDocName);

and then output as a stream:
ServiceResponse response = client.sendRequest(context, dataBinder);
InputStream inputStream = response.getResponseStream();

these are working fine most of time.
however, in the case there is exception that i can not get the file, instead of receiving exception, I still get a regular stream until I output stream as a string, I realized that it is a HDA format string that indicate the failure.

I wonder if there is any way to distinguish the failure and normal output without open the output stream as a string?
Thanks.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points