private IDocument CreateCheckedOutDocument(IFileInfo localFile, IObjectId parentId) {
IDocument result;
Dictionary<string, object> properties = new Dictionary<string, object>();
properties.Add(PropertyIds.Name, localFile.Name);
properties.Add(PropertyIds.ObjectTypeId, BaseTypeId.CmisDocument.GetCmisValue());
if (this.ServerCanModifyDateTimes) {
properties.Add(PropertyIds.CreationDate, localFile.CreationTimeUtc);
properties.Add(PropertyIds.LastModificationDate, localFile.LastWriteTimeUtc);
}
try {
var objId = this.Session.CreateDocument(
properties,
parentId,
null,
VersioningState.CheckedOut);
result = this.Session.GetObject(objId) as IDocument;
} catch (CmisConstraintException e) {
this.EnsureThatLocalFileNameContainsLegalCharacters(localFile, e);
throw;
}
OperationsLogger.Info(string.Format("Created remote private working copy document {0} for {1}", result.Id, localFile.FullName));
return result;
}
}