How to extract data from ContentHolder in Windc...

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;
}

你可能感兴趣的:(How to extract data from ContentHolder in Windc...)