コード例 #1
0
 /// <summary>
 /// Adds the <see cref="CloudFileNtfsAttributes"/> to the <see cref="StorageRequestMessage"/>
 /// </summary>
 /// <param name="request">The <see cref="StorageRequestMessage"/></param>
 /// <param name="properties">The <see cref="FileProperties"/></param>
 /// <param name="defaultValue">The default value to set if properties.ntfsAttributesToSet is null</param>
 private static void AddNtfsFileAttributes(
     StorageRequestMessage request,
     FileProperties properties,
     string defaultValue)
 {
     if (properties?.ntfsAttributesToSet != null)
     {
         request.AddOptionalHeader(Constants.HeaderConstants.FileAttributes, CloudFileNtfsAttributesHelper.ToString(properties.ntfsAttributesToSet.Value));
     }
     else
     {
         request.AddOptionalHeader(Constants.HeaderConstants.FileAttributes, defaultValue);
     }
 }
コード例 #2
0
        /// <summary>
        /// Sets the SMB related file properties.
        /// </summary>
        /// <param name="response">The web response.</param>
        /// <param name="properties">The properties to modify.</param>
        public static void UpdateSmbProperties(HttpResponseMessage response, FileDirectoryProperties properties)
        {
            properties.filePermissionKey = HttpResponseParsers.GetHeader(response, Constants.HeaderConstants.FilePermissionKey);
            properties.ntfsAttributes    = CloudFileNtfsAttributesHelper.ToAttributes(HttpResponseParsers.GetHeader(response, Constants.HeaderConstants.FileAttributes));
            properties.creationTime      = DateTimeOffset.Parse(HttpResponseParsers.GetHeader(response, Constants.HeaderConstants.FileCreationTime));
            properties.lastWriteTime     = DateTimeOffset.Parse(HttpResponseParsers.GetHeader(response, Constants.HeaderConstants.FileLastWriteTime));
            properties.ChangeTime        = DateTimeOffset.Parse(HttpResponseParsers.GetHeader(response, Constants.HeaderConstants.FileChangeTime));
            properties.DirectoryId       = HttpResponseParsers.GetHeader(response, Constants.HeaderConstants.FileId);
            properties.ParentId          = HttpResponseParsers.GetHeader(response, Constants.HeaderConstants.FileParentId);

            properties.filePermissionKeyToSet = null;
            properties.ntfsAttributesToSet    = null;
            properties.creationTimeToSet      = null;
            properties.lastWriteTimeToSet     = null;
        }