-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
ShareFileInfo.cs
80 lines (72 loc) · 2.61 KB
/
ShareFileInfo.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Text;
#pragma warning disable SA1402 // File may only contain a single type
namespace Azure.Storage.Files.Shares.Models
{
/// <summary>
/// Subset of the file's properties.
/// </summary>
public class ShareFileInfo
{
/// <summary>
/// The ETag contains a value which represents the version of the file, in quotes.
/// </summary>
public ETag ETag { get; internal set; }
/// <summary>
/// Returns the date and time the file was last modified.
/// </summary>
public DateTimeOffset LastModified { get; internal set; }
/// <summary>
/// The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise.
/// </summary>
public bool IsServerEncrypted { get; internal set; }
/// <summary>
/// The file's SMB properties.
/// </summary>
public FileSmbProperties SmbProperties { get; set; }
/// <summary>
/// Constructor.
/// </summary>
internal ShareFileInfo() { }
}
/// <summary>
/// FilesModelFactory provides utilities for mocking.
/// </summary>
public static partial class FilesModelFactory
{
/// <summary>
/// Creates a new StorageFileInfo instance for mocking.
/// </summary>
public static ShareFileInfo StorageFileInfo(
ETag eTag,
DateTimeOffset lastModified,
bool isServerEncrypted,
string filePermissionKey,
string fileAttributes,
DateTimeOffset fileCreationTime,
DateTimeOffset fileLastWriteTime,
DateTimeOffset fileChangeTime,
string fileId,
string fileParentId
)
=> new ShareFileInfo
{
ETag = eTag,
LastModified = lastModified,
IsServerEncrypted = isServerEncrypted,
SmbProperties = new FileSmbProperties
{
FileAttributes = ShareModelExtensions.ToFileAttributes(fileAttributes),
FilePermissionKey = filePermissionKey,
FileCreatedOn = fileCreationTime,
FileLastWrittenOn = fileLastWriteTime,
FileChangedOn = fileChangeTime,
FileId = fileId,
ParentId = fileParentId
}
};
}
}