Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加appendObject #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed 7za.exe
Binary file not shown.
1 change: 0 additions & 1 deletion BCLOUD

This file was deleted.

14 changes: 14 additions & 0 deletions BceSdkDotNet/BceConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public static class HttpHeaders

public const string Expires = "Expires";

public const string CacheControl = "Cache-Control";

public const string Host = "Host";

public const string LastModified = "Last-Modified";
Expand All @@ -75,6 +77,14 @@ public static class HttpHeaders

public const string BceAcl = "x-bce-acl";

public const string BceObjectAcl = "x-bce-object-acl";

public const string BceObjectGrantRead = "x-bce-object-grant-read";

public const string BceNextAppendOffset = "x-bce-next-append-offset";

public const string BceObjectType = "x-bce-object-type";

public const string BceContentSha256 = "x-bce-content-sha256";

public const string BceCopyMetadataDirective = "x-bce-metadata-directive";
Expand Down Expand Up @@ -265,5 +275,9 @@ public static class BceErrorCode
public const string RequestExpired = "RequestExpired";
public const string SignatureDoesNotMatch = "SignatureDoesNotMatch";
}

public static class BceObjectType{
public const string Appendable = "Appendable";
}
}
}
253 changes: 214 additions & 39 deletions BceSdkDotNet/Services/Bos/BosClient.cs

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions BceSdkDotNet/Services/Bos/Model/AppendObjectRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace BaiduBce.Services.Bos.Model
{
/// <summary>
/// Uploads a new object to the specified Baidu Bos bucket. The AppendObjectRequest optionally uploads object metadata
/// and applies a canned access control policy to the new object.
///
/// <para>
/// Baidu Bos never stores partial objects; if during this call an exception wasn't thrown, the entire object was stored.
/// </para>
/// </summary>
public class AppendObjectRequest : ObjectRequestBase
{
/// <summary>
/// The file containing the data to be uploaded to Baidu Bos. You must either
/// specify a file or an InputStream containing the data to be uploaded to
/// Baidu Bos.
/// </summary>
public FileInfo FileInfo { get; set; }
/// <summary>
/// The InputStream containing the data to be uploaded to Baidu Bos. You must
/// either specify a file or an InputStream containing the data to be
/// uploaded to Baidu Bos.
/// </summary>
public Stream Stream { get; set; }
/// <summary>
/// Optional metadata instructing Baidu Bos how to handle the uploaded data
/// (e.g. custom user metadata, hooks for specifying content type, etc.). If
/// you are uploading from an InputStream, you <bold>should always</bold>
/// specify metadata with the content size set, otherwise the contents of the
/// InputStream will have to be buffered in memory before they can be sent to
/// Baidu Bos, which can have very negative performance impacts.
/// </summary>
public ObjectMetadata ObjectMetadata { get; set; }

public long Offset { get; set; }

public long Size { get; set; }

public AppendObjectRequest()
{
ObjectMetadata = new ObjectMetadata();
}
}
}
32 changes: 32 additions & 0 deletions BceSdkDotNet/Services/Bos/Model/AppendObjectResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BaiduBce.Services.Bos.Model
{
/// <summary>
/// Contains the data returned by Baidu Bos from the <code>appendObject</code> operation.
/// Use this request to access information about the new object created from the
/// <code>appendObject</code> request, such as its ETag and optional version ID.
/// </summary>
public class AppendObjectResponse : BosResponseBase
{
public string ContentMd5 { get; set; }

public long BceNextAppendOffset { get; set; }

public string ContentEncoding { get; set; }
}
}
16 changes: 14 additions & 2 deletions BceSdkDotNet/Services/Bos/Model/ObjectMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ public class ObjectMetadata
/// according to RFC 1864. This data is used as an integrity check to verify
/// that the data received by the caller is the same data that was sent by
/// Baidu Bos.
///
///
/// <para>
/// This field represents the hex encoded 128-bit MD5 digest of an object's
/// content as calculated by Baidu Bos. The ContentMD5 field represents the
/// base64 encoded 128-bit MD5 digest as calculated on the caller's side.
///
///
/// </para>
/// </summary>
public string ETag { get; set; }
Expand All @@ -92,6 +92,18 @@ public class ObjectMetadata
/// </summary>
public string ContentRange { get; set; }

public int BceNextAppendOffset { get; set; }

public string BceObjectType { get; set; }

public string Expires { get; set; }

public string CacheControl { get; set; }

public string BceObjectAcl { get; set; }

public string BceObjectGrantRead { get; set; }

public ObjectMetadata()
{
UserMetadata = new Dictionary<String, String>();
Expand Down
2 changes: 0 additions & 2 deletions owner.txt

This file was deleted.

187 changes: 0 additions & 187 deletions upload.py

This file was deleted.