123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
-
- using System;
- using System.Globalization;
- using System.IO;
- namespace Aliyun.OSS
- {
-
-
-
-
-
-
-
-
-
-
- public class OssObject : IDisposable
- {
- private bool _disposed;
-
-
-
- public string Key { get; internal set; }
-
-
-
- public string BucketName { get; internal set; }
-
-
-
- public ObjectMetadata Metadata { get; internal set; }
-
-
-
- public Stream Content { get; internal set; }
-
-
-
- internal OssObject()
- { }
-
-
-
- internal OssObject(string key)
- {
- Key = key;
- }
- public override string ToString()
- {
- return string.Format(CultureInfo.InvariantCulture,
- "[OSSObject Key={0}, targetBucket={1}]", Key, BucketName ?? string.Empty);
- }
-
-
-
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
- protected virtual void Dispose(bool disposing)
- {
- if (!_disposed)
- {
- if (Content != null)
- Content.Dispose();
- _disposed = true;
- }
- }
- }
- }
|