Cmis.Utility.CmisNavigation.CreateDocument C# (CSharp) Method

CreateDocument() public method

public CreateDocument ( CmisPath path, ContentStream stream ) : IDocument
path CmisPath
stream ContentStream
return IDocument
        public IDocument CreateDocument(CmisPath path, ContentStream stream)
        {
            return CreateDocument(path, stream, null);
        }

Same methods

CmisNavigation::CreateDocument ( CmisPath path, ContentStream stream, object>.IDictionary properties ) : IDocument

Usage Example

/*
 TODO: enable support for propertie
        [Parameter(Position = 3, Mandatory = false)]
        public Hashtable Properties { get; set; }
*/

        protected override void EndProcessing()
        {
            var path = new CmisPath(Path);
            if (LocalFile != null && path.HasTrailingSlash())
            {
                path = path.Combine(System.IO.Path.GetFileName(LocalFile));
            }
            var nav = new CmisNavigation(CmisSession, WorkingFolder);
//            var props = Utilities.HashtableToDict(Properties);
            var stream = GetContentStream();
            try
            {
//                WriteObject(nav.CreateDocument(path, stream, props));
                WriteObject(nav.CreateDocument(path, stream, null));
            }
            catch (CmisBaseException e)
            {
                ThrowTerminatingError(new ErrorRecord(e, "CreateDocumentFailed",
                                                      ErrorCategory.WriteError, path));
            }
            finally
            {
                if (stream != null)
                {
                    stream.Stream.Close();
                }
            }
        }