AbstractTypeDefinition result = null;
if (typeDefinition instanceof CmisTypeFolderDefinitionType) {
result = new FolderTypeDefinitionImpl();
} else if (typeDefinition instanceof CmisTypeDocumentDefinitionType) {
result = new DocumentTypeDefinitionImpl();
((DocumentTypeDefinitionImpl) result).setContentStreamAllowed(convert(ContentStreamAllowed.class,
((CmisTypeDocumentDefinitionType) typeDefinition).getContentStreamAllowed()));
((DocumentTypeDefinitionImpl) result).setIsVersionable(((CmisTypeDocumentDefinitionType) typeDefinition)
.isVersionable());