-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
BlobHierarchyItem.cs
54 lines (48 loc) · 1.58 KB
/
BlobHierarchyItem.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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace Azure.Storage.Blobs.Models
{
/// <summary>
/// Either a <see cref="Prefix"/> or <see cref="Blob"/> returned from
/// <see cref="BlobContainerClient.GetBlobsByHierarchyAsync"/>.
/// </summary>
public class BlobHierarchyItem
{
/// <summary>
/// Gets a prefix, relative to the delimiter used to get the blobs.
/// </summary>
public string Prefix { get; internal set; }
/// <summary>
/// Gets a blob.
/// </summary>
public BlobItem Blob { get; internal set; }
/// <summary>
/// Gets a value indicating if this item represents a <see cref="Prefix"/>.
/// </summary>
public bool IsPrefix => Prefix != null;
/// <summary>
/// Gets a value indicating if this item represents a <see cref="Blob"/>.
/// </summary>
public bool IsBlob => Blob != null;
/// <summary>
/// Initialies a new instance of the BlobHierarchyItem class.
/// </summary>
/// <param name="prefix">
/// A prefix, relative to the delimiter used to get the blobs.
/// </param>
/// <param name="blob">
/// A blob.
/// </param>
internal BlobHierarchyItem(string prefix, BlobItem blob)
{
Prefix = prefix;
Blob = blob;
}
}
}