Skip to content
Closed
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
20 changes: 10 additions & 10 deletions storage/api/Storage.Samples/MoveObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
//
// 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
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// 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
// See the License for the specific language governing permissions and
// limitations under the License.

// [START storage_move_object]
Expand All @@ -20,19 +20,19 @@
public class MoveObjectSample
{
/// <summary>
/// Moves an object within a bucket with hierarchical namespace enabled.
/// Moves an object to a new name within the same bucket.
/// </summary>
/// <param name="sourceBucketName">Name of the source bucket containing the object to move.</param>
/// <param name="sourceObjectName">The name of the source object to move within the bucket.</param>
/// <param name="destinationObjectName">The name of the new object to move to within the bucket.</param>
/// <param name="sourceBucketName">Name of the bucket containing the object to move.</param>
/// <param name="sourceObjectName">The name of the source object to move.</param>
/// <param name="destinationObjectName">The name of the new object.</param>
public void MoveObject(
string sourceBucketName = "source-bucket-name",
string sourceObjectName = "source-object-name",
string destinationObjectName = "destination-object-name")
{
var storage = StorageClient.Create();
storage.MoveObject(sourceBucketName, sourceObjectName, destinationObjectName);
Console.WriteLine($"Moved {sourceBucketName}/{sourceObjectName} to " + $"{sourceBucketName}/{destinationObjectName} within a hierarchical namespace enabled bucket.");
Console.WriteLine($"Moved {sourceBucketName}/{sourceObjectName} to {sourceBucketName}/{destinationObjectName}.");
}
}
// [END storage_move_object]
// [END storage_move_object]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This change removes the trailing newline from the file. It's a common convention to end files with a newline character to ensure consistency and prevent issues with some command-line tools. Other files in this project, like MoveFile.cs, follow this convention. Please restore the newline at the end of the file.

// [END storage_move_object]