public static DocumentItem CreateDocumentItem([NotNull] string itemName, [NotNull] SynchContext synchContext, Stream stream = null)
        {
            Assert.ArgumentNotNull(itemName, "itemName");
            Assert.ArgumentNotNull(synchContext, "synchContext");

            var documentItem = new DocumentItem(itemName, synchContext.IntegrationConfigData.Folder, synchContext.IntegrationConfigData.List, new Uri(StringUtil.RemovePostfix('/', synchContext.IntegrationConfigData.Server) + StringUtil.EnsurePrefix('/', synchContext.IntegrationConfigData.Web)), synchContext.Context);

            documentItem.SetStream(stream ?? Stream.Null);
            documentItem.Update();

            return(documentItem);
        }
        public static void CopyBlobValue([NotNull] Item sourceIntegrationItem, [NotNull] DocumentItem targetSharepointItem)
        {
            Assert.ArgumentNotNull(sourceIntegrationItem, "sourceIntegrationItem");
            Assert.ArgumentNotNull(targetSharepointItem, "targetSharepointItem");

            Field blobField = sourceIntegrationItem.Fields[FieldNames.Blob];

            if (blobField == null || !blobField.IsBlobField)
            {
                return;
            }

            targetSharepointItem.SetStream(blobField.GetBlobStream() ?? Stream.Null);
        }