JcrFolder.setProperties(contentNode, getTypeDefinition(), properties);
// write content, if available
Binary binary = contentStream == null || contentStream.getStream() == null
? JcrBinary.EMPTY
: new JcrBinary(new BufferedInputStream(contentStream.getStream()));
try {
contentNode.setProperty(Property.JCR_DATA, binary);
if (contentStream != null && contentStream.getMimeType() != null) {
contentNode.setProperty(Property.JCR_MIMETYPE, contentStream.getMimeType());
}