Combine() public method

public Combine ( CmisPath other ) : CmisPath
other CmisPath
return CmisPath
Exemplo n.º 1
0
        public bool TryGet(CmisPath cmisPath, out ICmisObject obj)
        {
            var path = _curDir.Combine(cmisPath).ToString();

            obj = null;
            try
            {
                obj = _session.GetObjectByPath(path);
            }
            catch (CmisObjectNotFoundException)
            {
                return(false);
            }
            return(true);
        }
/*
 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();
                }
            }
        }