Class MLIClient
三商美邦 S3 客戶端
Inheritance
System.Object
MLIClient
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: com.emc.s3.lib
Assembly: com.emc.s3.lib.dll
Syntax
public class MLIClient : IMLIClient
Constructors
MLIClient()
建構式
Declaration
public MLIClient()
Fields
CREATE_TIME
Declaration
public const string CREATE_TIME = "x-amz-meta-createtime"
Field Value
Type | Description |
---|---|
System.String |
DATE_TIME_FORMAT_STRING
Declaration
public const string DATE_TIME_FORMAT_STRING = "yyyy-MM-ddTHH:mm:ssZ"
Field Value
Type | Description |
---|---|
System.String |
FILE_NAME
Declaration
public const string FILE_NAME = "x-amz-meta-filename"
Field Value
Type | Description |
---|---|
System.String |
ID
Declaration
public const string ID = "x-amz-meta-id"
Field Value
Type | Description |
---|---|
System.String |
MARKER_NO_MORE_PAGES
Declaration
public const string MARKER_NO_MORE_PAGES = "NO MORE PAGES"
Field Value
Type | Description |
---|---|
System.String |
MIME_TYPE
Declaration
public const string MIME_TYPE = "MimeType"
Field Value
Type | Description |
---|---|
System.String |
MIME_TYPE_DEFAULT
Declaration
public const string MIME_TYPE_DEFAULT = "text/plain"
Field Value
Type | Description |
---|---|
System.String |
OWNER
Declaration
public const string OWNER = "x-amz-meta-owner"
Field Value
Type | Description |
---|---|
System.String |
SIZE
Declaration
public const string SIZE = "x-amz-meta-size"
Field Value
Type | Description |
---|---|
System.String |
Methods
Clean()
清空
Declaration
public Result Clean()
Returns
Type | Description |
---|---|
Result | 執行結果 |
Examples
如何清空 Clean() 的方法
client.Clean();
Delete(Guid)
刪除
Declaration
public Result Delete(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | ID |
Returns
Type | Description |
---|---|
Result | 執行結果 |
Examples
如何刪除 Delete(Guid) 的方法
Guid guid = Guid.Parse(id);
var result = client.Delete(guid);
Download(Guid)
下載
Declaration
public DownloadResult Download(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | ID |
Returns
Type | Description |
---|---|
DownloadResult | 下載執行結果 |
Examples
如何下載 Download(Guid) 的方法
var guid = Guid.Parse(id);
var result = client.Download(guid);
ReadFully(Stream)
讀取所有內容
Declaration
public static byte[] ReadFully(Stream input)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | input | 輸入串流資料 |
Returns
Type | Description |
---|---|
System.Byte[] | 內容 |
Search(DateTime, DateTime)
查詢
Declaration
public SearchResult Search(DateTime begin, DateTime end)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | begin | 開始日期 |
System.DateTime | end | 結束日期 |
Returns
Type | Description |
---|---|
SearchResult | 查詢結果 |
Examples
如何查詢 Search(Guid) 的方法
var result = client.Search(DateTime.Now.AddDays(-2), DateTime.Now);
Search(Guid)
查詢
Declaration
public SearchResult Search(Guid id = default(Guid))
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | ID |
Returns
Type | Description |
---|---|
SearchResult | 查詢結果 |
Examples
如何查詢 Search(Guid) 的方法
var result = client.Search(Guid.Empty);
SearchByOwner(String)
查詢(依擁有者)
Declaration
public SearchResult SearchByOwner(string owner)
Parameters
Type | Name | Description |
---|---|---|
System.String | owner | 擁有者 |
Returns
Type | Description |
---|---|
SearchResult | 查詢結果 |
Examples
如何查詢 SearchByOwner(String) 的方法
var result = client.SearchByOwner("System");
Upload(UploadFileInfo)
上傳
Declaration
public Result Upload(UploadFileInfo fileInfo)
Parameters
Type | Name | Description |
---|---|---|
UploadFileInfo | fileInfo | 檔案 |
Returns
Type | Description |
---|---|
Result | 執行結果 |
Examples
如何上傳 Upload(UploadFileInfo) 的方法
byte[] content = null;
using (var reader = new BinaryReader(file.InputStream))
{
content = reader.ReadBytes(file.ContentLength);
}
var uploadFileInfo = new UploadFileInfo() { ID = Guid.NewGuid(), Content = content, Owner = "Test" };
var result = client.Upload(uploadFileInfo);