Hi Manikandan,
Please try the following code in any utility class,
ContentHolder content = ContentHelper.service.getContents((ContentHolder)documentObject);
Vector<?> vcontent = ContentHelper.getApplicationData(content); // this will return all contents
if(vcontent.size() > 0){
for(int i=0; i<vcontent.size(); i++) {
wt.content.ApplicationData appData = (ApplicationData)vcontent.get(i);
String currfileName = appData.getFileName();
File saveAsFile= new java.io.File("D:/",currfileName); // input your location and file name
ContentServerHelper.service.writeContentStream((ApplicationData)appData, saveAsFile.getCanonicalPath());
}
}
you can also download the content for role too, have look on following method and modify to suit your requirement,
QueryResultgetContentsByRole(ContentHolder holder, ContentRoleType role) throws WTException
public static final ContentRoleTypePRIMARY
public static final ContentRoleTypeSECONDARY
Njoy,
MKR