Ejemplo n.º 1
0
        /// <summary>Atomically create or replace a single large object.</summary>
        /// <remarks>
        /// Atomically create or replace a single large object.
        /// <p>
        /// Initially the returned output stream buffers data into memory, but if the
        /// total number of written bytes starts to exceed an internal limit the data
        /// is spooled to a temporary file on the local drive.
        /// <p>
        /// Network transmission is attempted only when <code>close()</code> gets
        /// called at the end of output. Closing the returned stream can therefore
        /// take significant time, especially if the written content is very large.
        /// <p>
        /// End-to-end data integrity is assured by internally computing the MD5
        /// checksum of the supplied data and transmitting the checksum along with
        /// the data itself.
        /// </remarks>
        /// <param name="bucket">name of the bucket storing the object.</param>
        /// <param name="key">key of the object within its bucket.</param>
        /// <param name="monitor">
        /// (optional) progress monitor to post upload completion to
        /// during the stream's close method.
        /// </param>
        /// <param name="monitorTask">(optional) task name to display during the close method.
        ///     </param>
        /// <returns>a stream which accepts the new data, and transmits once closed.</returns>
        /// <exception cref="System.IO.IOException">if encryption was enabled it could not be configured.
        ///     </exception>
        public virtual OutputStream BeginPut(string bucket, string key, ProgressMonitor monitor
                                             , string monitorTask)
        {
            MessageDigest   md5    = NewMD5();
            TemporaryBuffer buffer = new _LocalFile_455(this, bucket, key, md5, monitor, monitorTask
                                                        );

            return(encryption.Encrypt(new DigestOutputStream(buffer, md5)));
        }
Ejemplo n.º 2
0
		/// <summary>Atomically create or replace a single large object.</summary>
		/// <remarks>
		/// Atomically create or replace a single large object.
		/// <p>
		/// Initially the returned output stream buffers data into memory, but if the
		/// total number of written bytes starts to exceed an internal limit the data
		/// is spooled to a temporary file on the local drive.
		/// <p>
		/// Network transmission is attempted only when <code>close()</code> gets
		/// called at the end of output. Closing the returned stream can therefore
		/// take significant time, especially if the written content is very large.
		/// <p>
		/// End-to-end data integrity is assured by internally computing the MD5
		/// checksum of the supplied data and transmitting the checksum along with
		/// the data itself.
		/// </remarks>
		/// <param name="bucket">name of the bucket storing the object.</param>
		/// <param name="key">key of the object within its bucket.</param>
		/// <param name="monitor">
		/// (optional) progress monitor to post upload completion to
		/// during the stream's close method.
		/// </param>
		/// <param name="monitorTask">(optional) task name to display during the close method.
		/// 	</param>
		/// <returns>a stream which accepts the new data, and transmits once closed.</returns>
		/// <exception cref="System.IO.IOException">if encryption was enabled it could not be configured.
		/// 	</exception>
		public virtual OutputStream BeginPut(string bucket, string key, ProgressMonitor monitor
			, string monitorTask)
		{
			MessageDigest md5 = NewMD5();
			TemporaryBuffer buffer = new _LocalFile_455(this, bucket, key, md5, monitor, monitorTask
				);
			return encryption.Encrypt(new DigestOutputStream(buffer, md5));
		}