Hi,
I am trying to download a PFD file from documentum using r_object_id but getting error. Can any one share a sample code to download a file from documentum.
To get the content from an object is quite simple using dfc. You need something like below:
// 1) Fetch the content you need
IDfSysObject myObject = (IDfSysObject) dfSession.getObject(r_object_id);
ByteArrayInputStream yourContent = myObject.getContent();
// 2) Use the stream to do what you need
Can you provide code and stack ?
You can use the DfSysObject.getFile() method like this:
// build the file name (file name will be object id plus format extension)
String filename = sysObj.getObjectId().toString() + "." + sysObj.getFormat().getDOSExtension();
// download the file and hold the full path as a string
> ..getObjectId().toString()
I hate to see that... there may come a day this will give you some serialized Java object like someclass@somehash and all that code crashes.
I prefer using ..getObjectId().getId()
i am not using DFC for this what i am using is rest service to connect to documentum repository
Good point!
Can you share the exception ?
Have you had a chance to visit ? Some useful references for you:
Regards,
William