VersioningState versioningState, boolean unfiled) throws Exception {
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(PropertyIds.NAME, name);
properties.put(PropertyIds.OBJECT_TYPE_ID, type);
ContentStream content = createContentStream(name, length, seed);
return clientSession.getSession().createDocument(properties, (unfiled ? null : currentFolder), content,
versioningState, null, null, null);
}