Files
g.hnyhua.cn/COSXML/Model/Object/HeadObjectResult.cs
2026-02-07 15:48:27 +08:00

58 lines
1.8 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
using System.Collections.Generic;
using System.Text;
namespace COSXML.Model.Object
{
/// <summary>
/// 检索对象返回的结果
/// <see cref="https://cloud.tencent.com/document/product/436/7745"/>
/// </summary>
public sealed class HeadObjectResult : CosResult
{
/// <summary>
/// 用来表示 Object 是否可以被追加上传枚举值normal 或者 appendable
/// </summary>
public string cosObjectType;
/// <summary>
/// Object 的存储级别枚举值STANDARD,STANDARD_IA
/// <see cref="Common.CosStorageClass"/>
/// </summary>
public string cosStorageClass;
/// <summary>
/// 对象的长度
/// </summary>
public long size;
/// <summary>
/// 对象的eTag
/// </summary>
public string eTag;
internal override void InternalParseResponseHeaders()
{
List<string> values;
this.responseHeaders.TryGetValue("x-cos-object-type", out values);
if (values != null && values.Count > 0)
{
cosObjectType = values[0];
}
this.responseHeaders.TryGetValue("x-cos-storage-class", out values);
if (values != null && values.Count > 0)
{
cosStorageClass = values[0];
}
this.responseHeaders.TryGetValue("Content-Length", out values);
if (values != null && values.Count > 0)
{
long.TryParse(values[0], out size);
}
this.responseHeaders.TryGetValue("ETag", out values);
if (values != null && values.Count > 0)
{
eTag = values[0];
}
}
}
}