How to extract data from ContentHolder in Windchill

How to extract data from ContentHolder in Windchill

Add Comment
1 Answer(s)
public static String extractContent(ContentHolder contentHolder, String location, ContentRoleType contentRoleType) throws Exception {
contentHolder = ContentHelper.service.getContents(contentHolder);
QueryResult contents = ContentHelper.service.getContentsByRole(contentHolder, contentRoleType);
ApplicationData applicationdata = ((ApplicationData)contents.nextElement()); //It is assumed that there is a content else error
String filePath = location + "/" + applicationdata.getFileName();
ContentServerHelper.service.writeContentStream(applicationdata, filePath);
return filePath;
}
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.