/// <summary>
        /// Applies the appropiate properties to the specified request for this implementation.
        /// </summary>
        /// <param name="request">The request.</param>
        public void Apply(ICloudFilesRequest request)
        {
            request.Method = "PUT";

            if (_metadata != null && _metadata.Count > 0)
            {
                foreach (var s in _metadata.Keys)
                {
                    request.Headers.Add(Constants.META_DATA_HEADER + s, _metadata[s]);
                }
            }

            request.AllowWriteStreamBuffering = false;
            request.ContentType = ContentType();
            request.SetContent(_fileToSend, Progress);
        }
        /// <summary>
        /// Applies the appropiate properties to the specified request for this implementation.
        /// </summary>
        /// <param name="request">The request.</param>
        public void Apply(ICloudFilesRequest request)
        {
            request.Method = "PUT";

            if (_metadata != null && _metadata.Count > 0)
            {
                foreach (var s in _metadata.Keys)
                {
                    request.Headers.Add(Constants.META_DATA_HEADER + s, _metadata[s]);
                }
            }

            request.AllowWriteStreamBuffering = false;
            request.ContentType = ContentType();
            request.SetContent(_fileToSend, Progress);
        }
 /// <summary>
 /// Applies the appropiate properties to the specified request for this implementation.
 /// </summary>
 /// <param name="request">The request.</param>
 public void Apply(ICloudFilesRequest request)
 {
     request.Method = "PUT";
     request.ContentType = "application/directory";
     request.SetContent(new MemoryStream(new byte[0]), delegate { });
 }
Example #4
0
 /// <summary>
 /// Applies the appropiate properties to the specified request for this implementation.
 /// </summary>
 /// <param name="request">The request.</param>
 public void Apply(ICloudFilesRequest request)
 {
     request.Method      = "PUT";
     request.ContentType = "application/directory";
     request.SetContent(new MemoryStream(new byte[0]), delegate { });
 }
        /// <summary>
        /// Applies the appropiate properties to the specified request for this implementation.
        /// </summary>
        /// <param name="request">The request.</param>
        public void Apply(ICloudFilesRequest request)
        {
            _fileToSend.Position = 0;
            request.Method = "PUT";

            if (_metadata != null && _metadata.Count > 0)
            {
                foreach (var m in _metadata)
                {
                    if ((String.IsNullOrEmpty(m.Key)) || (String.IsNullOrEmpty(m.Value)))
                    {
                        continue;
                    }

                    if (m.Key.StartsWith(Constants.META_DATA_HEADER, StringComparison.InvariantCultureIgnoreCase))
                    {
                        // make sure the metadata item isn't just the container metadata prefix string
                        if (m.Key.Length > Constants.META_DATA_HEADER.Length)
                        {
                            // If the caller already added the container metadata prefix string,
                            // add their key as is.
                            request.Headers.Add(m.Key, m.Value);
                        }
                    }
                    else
                    {
                        request.Headers.Add(Constants.META_DATA_HEADER + m.Key, m.Value);
                    }
                }
            }

            request.AllowWriteStreamBuffering = false;
            request.ContentType = ContentType();
            request.SetContent(_fileToSend, Progress);
        }