How to extract data from ContentHolder in Windchill

How to extract data from ContentHolder in Windchill

Alex Trainee Asked on May 16, 2015 in Windchill PDMLink.
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;

}

guru@windchillguru.com Guru Answered on May 16, 2015.
Add Comment

Your Answer

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