コード例 #1
0
        /// <summary>
        /// Constructor for objects.
        /// </summary>
        public AtomEntryWriter(IObjectData objectData, CmisVersion cmisVersion, IContentStream contentStream)
        {
            if (objectData == null || objectData.Properties == null)
            {
                throw new CmisInvalidArgumentException("Object and properties must not be null!");
            }

            if (contentStream != null && contentStream.MimeType == null)
            {
                throw new CmisInvalidArgumentException("Media type must be set if a stream is present!");
            }

            this.objectData    = objectData;
            this.cmisVersion   = cmisVersion;
            this.contentStream = contentStream;
            if (contentStream != null && contentStream.Stream != null)
            {
                // do we need buffering here?
                stream = contentStream.Stream;
            }
            else
            {
                stream = null;
            }
            this.typeDef    = null;
            this.bulkUpdate = null;
        }
コード例 #2
0
        /// <summary>
        /// Constructor for bulk updates.
        /// </summary>
        public AtomEntryWriter(BulkUpdate bulkUpdate)
        {
            if (bulkUpdate == null)
            {
                throw new CmisInvalidArgumentException("Bulk update data must not be null!");
            }

            this.bulkUpdate    = bulkUpdate;
            this.typeDef       = null;
            this.cmisVersion   = CmisVersion.Cmis_1_1;
            this.objectData    = null;
            this.contentStream = null;
            this.stream        = null;
        }
コード例 #3
0
        /// <summary>
        /// Constructor for types.
        /// </summary>
        public AtomEntryWriter(ITypeDefinition type, CmisVersion cmisVersion)
        {
            if (type == null)
            {
                throw new CmisInvalidArgumentException("Type must not be null!");
            }

            this.typeDef       = type;
            this.cmisVersion   = cmisVersion;
            this.objectData    = null;
            this.contentStream = null;
            this.stream        = null;
            this.bulkUpdate    = null;
        }
コード例 #4
0
 /// <summary>
 /// Constructor for objects.
 /// </summary>
 public AtomEntryWriter(IObjectData objectData, CmisVersion cmisVersion)
     : this(objectData, cmisVersion, null)
 {
 }