private static final String CONTENT_CATEGORY_NAME = "INSERT_CONTENT_CATEGORY_NAME_HERE";
public static void runExample(
DfaServices dfaServices, DfaSession session, String contentCategoryName) throws Exception {
// Request the service.
ContentCategoryRemote service = dfaServices.get(session, ContentCategoryRemote.class);
// Create the content category.
ContentCategory contentCategory = new ContentCategory();
contentCategory.setId(0);
contentCategory.setName(contentCategoryName);
// Save the content category.
ContentCategorySaveResult contentCategorySaveResult =
service.saveContentCategory(contentCategory);
// Display the new content category ID.
System.out.printf("Content category with ID \"%s\" was created.%n",
contentCategorySaveResult.getId());
}